-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add date to front matter when publishing draft #55
Comments
I had a go at implementing this but I can't see a good way to solve this without introducing code that could destructively alter source files and cause unexpected behaviour with posting dates. The easiest nearly fix would be to add a date to a draft when it is created, but this then causes problems publishing with the Parsing source files and altering their contents seems like a recipe for breaking or losing posts. Maybe publishing could try to set the published date in the front matter and not remove the draft so the original isn't lost, but it could still cause lost or corrupted posts so would need to try to explain this to the user every time they published... yuck. Do you have a better idea I've missed? |
My general idea was that the script would:
But unfortunately, I haven't had time yet to take a look at how complicated it might be to implement. |
I think this is the right approach |
If you like, take a look at #63. |
Hmm, instead of altering the file contents as well with It can alter any post, draft or not. Jekyll seems to prefer the yaml front matter over the filename for posts, so All the logic for prompting the user and/or making backups before editing files would be handled by that command, and not mixed with publish and unpublish. Downside: in some cases, more than one command is needed to publish a draft. Also, published posts with dates that are unpublished with a date must be touched to be correct. Upside: simplifies |
Has PR #63 |
Conceptually mostly the same thing as #54 but should add date to existing file when running
jekyll publish path/to/draft
The text was updated successfully, but these errors were encountered: