Statiq.Web
Statiq.Web copied to clipboard
Auto update publish date based on system timestamp
When publishing a blog post I regularly forget to update the date in the frontmatter.
I'm thinking about an extra flag in the wyam build
command to (like --update-publish-date
to set the Date
value of each post to the last modified date. The only issue I have is when I set a date in the future for "draft" posts.
Using the last file write time is a great idea as a fallback. I don't think we even need a flag - right now the recipe looks first for metadata and then at the file name. If neither of those result in a usable date, the last file modified date could be used instead of just punting on the post.
I'm going to add this one to the v3 milestone - it's a fairly simple change and since I'll be porting the recipes to Splashdown anyway... (see #668).
Using the last file write time is a great idea as a fallback. I don't think we even need a flag - right now the recipe looks first for metadata and then at the file name. If neither of those result in a usable date, the last file modified date could be used instead of just punting on the post.
Good point. I didn't know we can add a date to the filename.