Statiq.Web icon indicating copy to clipboard operation
Statiq.Web copied to clipboard

Auto update publish date based on system timestamp

Open johanvergeer opened this issue 5 years ago • 3 comments

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.

johanvergeer avatar May 28 '19 08:05 johanvergeer

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.

daveaglick avatar May 28 '19 12:05 daveaglick

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

daveaglick avatar May 28 '19 12:05 daveaglick

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.

johanvergeer avatar Jun 01 '19 16:06 johanvergeer