Hello people wise in the ways of #Eleventy - what's the best way to show both the original post date of a blog post and, optionally, the date it was last modified? 🙏
=> More informations about this toot | More toots from tink@w3c.social
@tink Hey! I know you can add a parameter in a YAML Front-Matter that automatically collects some key dates, like the "Last Modified" date. The documentation is here: https://www.11ty.dev/docs/dates/
=> More informations about this toot | More toots from boostmarks@hachyderm.io
@boostmarks @tink I was also thinking about these Eleventy date adjustment keywords. But they always override the “page.date” property, right? So it wouldn’t be an additional “lastModified” property accessible from the template but still the “date” property, now with a different value.
=> More informations about this toot | More toots from mvsde@mastodon.social
@boostmarks @tink There is a discussion on GitHub talking about this and the solution there is to manually set up frontmatter to track the modified date:
https://github.com/11ty/eleventy/discussions/2332
There’s also a GitHub issue asking for the date keywords for other data properties than “date”, but this didn’t go anywhere yet:
https://github.com/11ty/eleventy/issues/2660
=> More informations about this toot | More toots from mvsde@mastodon.social
@mvsde @boostmarks @tink that’s what I ended up doing (a lastupdated
property in the front matter). Slightly more work but also more control? Like an update to the front matter—and thereby git commit date—doesn’t necessarily equal a content/article update imo.
=> More informations about this toot | More toots from moiety@front-end.social
@moiety Agreed. I don't want/need every minor modification to the post to be flagged, only substantive updates, so this frontmatter approach looks like a good fit.@mvsde @boostmarks
=> More informations about this toot | More toots from tink@w3c.social This content has been proxied by September (3851b).Proxy Information
text/gemini