hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

9.7K
active users

Andy Davies

@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!

@simoncox @zachleat Think I might just create yyyy/mm/dd folders for the existing content

If seems to work OK when I create a new post but Eleventy doesn't seem to like my existing content for some reason

@andydavies @zachleat

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):

@zachleat @andydavies

That is sweet!
Yes have been using Luxon since day 2! First extra bit i put in. :) Got to have the right date formats!

@zachleat @simoncox I might go for the folder option anyway as it allows me to keep the images with the post text

@andydavies @zachleat

A lot of people do that - I tend to keep mine in an assets folder. :)