Skip to content
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

Merged
merged 1 commit into from
Nov 7, 2019
Merged

Generate last_updated #363

merged 1 commit into from
Nov 7, 2019

Conversation

mikegeyser
Copy link
Contributor

@mikegeyser mikegeyser commented Nov 7, 2019

This closes #317.

This PR adds a generate script for the last_updated timestamp on every content file. It is not tightly coupled to the generate_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 the last_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.

@mikegeyser mikegeyser added enhancement New feature or request development Building the Almanac tech stack labels Nov 7, 2019
@mikegeyser mikegeyser added this to the SHIP IT! milestone Nov 7, 2019
@mikegeyser mikegeyser self-assigned this Nov 7, 2019
const date_string = /Date:\s+(\S*)/g.exec(stdout)[1];
const date = new Date(date_string);

return date.toISOString();
Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Member

@tunetheweb tunetheweb left a 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).

@rviscomi rviscomi merged commit 8f43861 into master Nov 7, 2019
@rviscomi rviscomi deleted the generate-timestamp branch November 7, 2019 21:25
ernee added a commit that referenced this pull request Nov 7, 2019
* Added a generate script for the last_updated timestamp. (#363)

* upload cms images
rviscomi pushed a commit that referenced this pull request Nov 7, 2019
* cms chapter markdown 

fixes #169

* Update cms.md

* Update cms.md

* Update cms.md

* Ernee patch 2 (#365)

* Added a generate script for the last_updated timestamp. (#363)

* upload cms images

* Optimised images with calibre/image-actions

* generate cms markup

* Update cms.md

* merge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Building the Almanac tech stack enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autogenerate timestamps
3 participants