Slug should *just* be the name
See original GitHub issueAt the moment, in the front-matter we have that the slug
is a whole path. For example Web/HTML/Element/video
when it just needs to, for example:
slug: video
One disadvantage with having the whole path in there is that if you need to rename a slug, you now need to git edit every single index.html
that exists below.
Another disadvantage is that it’s a foot-gun. You might accidentally edit from slug: Web/HTML/Element/video
to slug: We/HTML/Element/video
without really noticing.
Lets make the importer just put slug: ${basename(document.slug))
in there. And in the Yari code, we can no longer make the url
be ${locale}/docs/${slug}
but it needs to become based on looping over the path and doing a Document.findByUrl(...)
for each forward-slash.
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
What Are Slugs And How To Name Them In WordPress (2021)
In this section, we will teach you how to name your slugs to optimize them for SEO and readability. This section will be...
Read more >What is a slug? - NationBuilder HOWTOs
A slug is the “name” of your NationBuilder site. For example, my site is awesome.nationbuilder.com - so “awesome” is my slug. Slugs are...
Read more >WordPress Slugs: What They Are & How to Change Them
A slug is a part of a permalink. More specifically, it's the name of the page or post at the end of the...
Read more >What is a slug in WordPress (and bad practices you should ...
The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens. It goes...
Read more >What is a slug? - Awards Management Software
What is a slug? Well, the name “slug” comes from web publishing, and refers usually to part of a URL which identifies a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
My recommendation is that we start gently. You start by writing a piece of code where we’re currently extracting the slug from the front-matter and make it smart. Something like this:
That way, at your convenience you can pick an
index.html
in mdn/content and either remove the slug or if it needs casing you rename it…Okay, so what would be needed in code and content next?