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

Support LATEST_POST and SITE_TIME keywords in last_modified_at front matter #234

Open
wants to merge 2 commits into
base: master
from

Conversation

@tsjensen
Copy link

commented Jan 25, 2019

This is a little PR which adds an enhancement to the last_modified_at front matter value in pages. Currently, the value of last_modified_at in a page's front matter can only be a time stamp. With this PR, it can also be one of these values:

  • SITE_TIME – placeholder for the time of the latest Jekyll run (actually the value of site.time)
  • LATEST_POST – placeholder for the date of the most recent post

Especially the latter is very helpful for a "What's new" page, which shows a list of recent posts. This "What's new" page will update whenever there is a new post, and by specifying last_modified_at: LATEST_POST, our sitemap can reflect that.

I also added a line to the Gemfile adding tzinfo-data, in order to enable running the tests on Windows.

Let me know if anything is unclear, or I misunderstood something. Thanks for considering this!

Add SITE_TIME and LATEST_POST keywords
These strings can be used instead of a date in order to refer to the time
of the latest Jekyll run, or the date of the latest post, respectively.
This works only on pages, nto on static files or posts.

@tsjensen tsjensen force-pushed the tsjensen:lastmod-keywords branch from 967d289 to 5cb942e Jan 25, 2019

@tsjensen tsjensen force-pushed the tsjensen:lastmod-keywords branch from 5cb942e to c468989 Jan 25, 2019

@RDIL

This comment has been minimized.

Copy link

commented Feb 2, 2019

Cool, Thanks!!! Looks like a nice feature :)

@pathawks

This comment has been minimized.

Copy link
Member

commented Feb 2, 2019

I see the value in this feature, but I wonder if this plugin is the best place for it. It seems to me like the last-modified-at plugin is the logical place for this to go.

@tsjensen

This comment has been minimized.

Copy link
Author

commented Feb 2, 2019

@pathawks I was thinking of Github Pages users, who can‘t use last-modified-at.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.