GitXplorerGitXplorer
g

jekyll-last-modified-at

public
241 stars
39 forks
21 issues

Commits

List of commits on branch main.
Verified
3052cbe5fdf550dd1e85ed8eb7ec7a5595cd9f1d

fix package name

ggjtorikian committed 3 months ago
Verified
d84d8596a5fd91303d18ed2a0219012bca438d08

Add package tasks

ggjtorikian committed 3 months ago
Verified
965034331a47b1a28d3210f0e003d9b138e3fe85

Merge pull request #103 from gjtorikian/release/v1.3.2

ggithub-actions[bot] committed 3 months ago
Unverified
a9d5bc300bdc101b32f72a9002097b0ade83ffab

[skip test] update changelog

ggjtorikian committed 3 months ago
Verified
ab30d76ce5de3959c379e6c7190097e7df5bb3dd

Merge pull request #102 from gjtorikian/version2

ggjtorikian committed 3 months ago
Verified
f5006ecab974e65409c31a89d930141c492dda85

:gem: 1.3.2

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.)