Skip to content

Dead simple plugin to return the last modified date of a file. Useful to build a better sitemap.xml :)

License

Notifications You must be signed in to change notification settings

michaelx/jekyll-last-modified

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

jekyll-last-modified

Dead simple Jekyll plugin to return the last modified date of a file. Useful to build a better sitemap.xml :)

Installation

Copy jekyll-last-modified.rb into the /_plugins/ directory of your Jekyll project.

Usage

Basic Example

The plugin adds a new custom liquid tag, which can be used as follows:
{% last_modified /myfile/index.html %}

You can also use liquid objects within the tag:
{% last_modified {{ post.path }} %}

Production Example

I’m using the plugin on My Morning Routine to use the last modified date for <lastmod> in our sitemap.xml:

<lastmod>{% capture lastmod_date %}{% last_modified {{ post.path }} %}{% endcapture %}{{ lastmod_date | date_to_xmlschema }}</lastmod>

Credits

About

Dead simple plugin to return the last modified date of a file. Useful to build a better sitemap.xml :)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages