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 @tink You're right, I assumed you wanted this, and my experience is quite limited another way. What if you use the date parameter for Last Modified and another one for a manually inputted date?
=> More informations about this toot | More toots from boostmarks@hachyderm.io
@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
@tink Raymond Camden did a post about this last year
https://www.raymondcamden.com/2023/08/31/fun-with-front-matter-part-3-handling-edits
=> More informations about this toot | More toots from alexei@mapstodon.space
@alexei Thanks. That looks promising!
Thanks also to @boostmarks and @mvsde for pointers and suggestions.
=> More informations about this toot | More toots from tink@w3c.social This content has been proxied by September (3851b).Proxy Information
text/gemini