GitXplorerGitXplorer
g

jekyll-last-modified-at

public
241 stars
39 forks
21 issues

Commits

List of commits on branch main.
Verified
d8f8a33d8dcc9a9a01ad3da30211939b8ed57c02

update workflows

ggjtorikian committed 3 months ago
Verified
a4915752e149dfd1368dc9303cf86aa15d480fd6

Merge pull request #101 from gjtorikian/new-release

ggjtorikian committed 3 months ago
Verified
2bfc590cb9fffc4e4ef14e366778d3733508e153

update rake task

ggjtorikian committed 3 months ago
Verified
aad570544f8b2318146788806a96e7f0db26ccf6

:gem: 1.3.1

ggjtorikian committed 3 months ago
Verified
2ea2bca3fcecb392dfe1c517998df977a6cf7db8

Merge pull request #100 from gjtorikian/lint

ggjtorikian committed 3 months ago
Verified
47ec1102bee694b4754812cf231f6c5207e188c1

lint

ggjtorikian committed 3 months ago

README

The README file for this repository.

Last Modified At Plugin

A liquid tag for Jekyll to indicate the last time a file was modified.

This plugin determines a page's last modified date by checking the last Git commit date of source files. In the event Git is not available, the file's mtime is used.

Setting up

Open your Gemfile in your Jekyll root folder and add the following:

group :jekyll_plugins do
  gem "jekyll-last-modified-at"
end

Add the following to your site's _config.yml file

plugins:
  - jekyll-last-modified-at

# Optional. The default date format, used if none is specified in the tag.
last-modified-at:
    date-format: '%d-%b-%y'

Usage

There are a few ways to use this gem.

You can place the following tag somewhere within your layout:

{% last_modified_at %}

By default, this creates a time format matching "%d-%b-%y" (like "04-Jan-14").

You can also choose to pass along your own time format. For example:

{% last_modified_at %Y:%B:%A:%d:%S:%R %}

That produces "2014:January:Saturday:04."

You can also call the method directly on a Jekyll "object," like so:

{{ page.last_modified_at }}

To format such a time, you'll need to rely on Liquid's date filter:

{{ page.last_modified_at | date: '%Y:%B:%A:%d:%S:%R' }}

(It's generally more performant to use the page.last_modified_at version of this plugin.)