-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
Generate last_updated #363
Conversation
const date_string = /Date:\s+(\S*)/g.exec(stdout)[1]; | ||
const date = new Date(date_string); | ||
|
||
return date.toISOString(); |
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.
This uses the ISO_8601 format of representing UTC timezone with a Z
, instead of +00:00
. I can change this if needed.
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.
As per #317 (comment) think that is fine.
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.
LGTM! Only doing the chapter pages for now so future enhancement could do the non-chapter pages in a similar manner (though there the datestamp is directly in the HTML as no .md file).
* Added a generate script for the last_updated timestamp. (#363) * upload cms images
This closes #317.
This PR adds a generate script for the
last_updated
timestamp on every content file. It is not tightly coupled to thegenerate_chapters
functionality, because we might want it to be a pre-commit hook instead. At the moment it will run first and uses the date of the latest commit on the file to generate thelast_modified
.I'm a little nervous of the updating of source files, but I do think it's better than having to do it by hand.