@zachleat Have started porting my blog to Eleventy but have a question…
My current markdown files start yyyy-mm-dd-title.of.post and get translated into a URL of /blog/yyyy/mm/dd/title.of.post
Is there an article that explains how to do this in Eleventy anywhere or at least gives pointers - had a search and couldn’t find one but that might just be my unfamiliarity with Eleventy’s terms
@andydavies permalink is the word you need, probably set in a directory data file to apply to all files in the directory
@zachleat Thanks I’ll give it a look
@andydavies @zachleat
I have my eleventy posts set up as /post/yyyy-mm-dd-title. md. I think I just write them out that way - though now have a node script to set them up each time!
Oh - sorry, I misread your original post - your final URL structure is actually with folders! i think you will need to replicate that with your .md files - as you have said. :).
@simoncox @andydavies objection!! This will work, with a permalink JavaScript function (you’ll have the zero pad the month and date though):
@simoncox @andydavies luxon is a dep eleventy uses internally that you could use to help simplify the date code: https://moment.github.io/luxon/#/formatting
That is sweet!
Yes have been using Luxon since day 2! First extra bit i put in. :) Got to have the right date formats!
A lot of people do that - I tend to keep mine in an assets folder. :)