Add automatic `fileSlug` key from file name
See original GitHub issueMatch {slug-name}.md
or YYYY-MM-DD-{slug-name}.md
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Permalinks — Eleventy
Eleventy automatically helps you make sure that Cool URIs don't change. What to leave out… File name extension. This is a very common...
Read more >Renaming files: annoying automatic re-selection of entire
At first, I would wait a few seconds, hit "Home" or the left arrow key, and then work on renaming the file hoping...
Read more >Architecting data in Eleventy - Sia Karamalegos
In my /posts/ folder, I can create a file with the same name as the folder and with either a .json , .11tydata.json...
Read more >Auto-Enter a File Name - YouTube
Grabbing the name from a document inserted into a FileMaker Container field can be done with the Auto -Enter feature and the ...
Read more >How would you make a unique filename by adding a number?
public FileInfo MakeUnique(string path) { string dir = Path.GetDirectoryName(path); string fileName = Path.
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 FreeTop 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
Top GitHub Comments
Any progress on this one? I tried to patch it by creating a filter and using this in permalink creation, but turns out that
page.url
returns an incorrect value when using this approach — another bug?Given the filter I created, while the desired files are created (
/path/to/slug.html
),page.url
returns/path/to/.html
(slug is missing). 🤔At this point in the world of static site generators,
index.*
is a special breed. Its main use is creating extension-less permalinks (e.g.thing/index.html
can be reached atthing/
if the web server is set up that way).Now inferring the slug from a file’s name would generate
index
fromindex.html
andthing
fromthing.md
. That’s very consistent. However, it’s not useful. In this case, it would mean trading consistency for the capability of writing meta data-less content.As shown above, in a directory-specific data file one can specifiy a dynamic permalink based on
{{ slug }}
. However, one would not be able to generate anindex.html
at the root of that directory as the consistent solution always creates a slug; thus, a sub-directory will be created.Another thought:
thing.md
producingthing/index.html
is already inconsistent. Isindex
the title of that document?thing
seems to be the slug. Thenindex
can’t be. Ifindex
is not the slug, why isindex.html
resulting inindex/indext.html
?Also, let me just clarify that I see why this rings your alarm bells. Breaking consistency always does. Let me know if I should clarify some bits. I’ve got the feeling that this already sounds rather abstract.