-
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 in new posts #43
Conversation
This is the very first feature I found myself wanting when first trying jekyll-compose. +1 |
Bump ? Would also like this feature |
@parkr any chances for this? :) |
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! One request for the subclass implementation of #content
, and it'd be great to have a quick test for this!
@@ -53,6 +53,11 @@ def file_name | |||
def _date_stamp | |||
@params.date.strftime '%Y-%m-%d' | |||
end | |||
|
|||
def content |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Subclasses should accept the same number of arguments as the superclass so this should be def content(front_matter = {})
.
def content(front_matter = {})
front_matter.merge!({"date" => @params.data.strftime("%Y-%m-%d %H:%M %z")})
super
end
That should work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xianny can you update this please :)?
When making new posts, I'd like to auto-generate date/timestamp to front matter. Thoughts?