2
0
mirror of https://github.com/inventree/inventree-website.git synced 2025-07-03 12:10:47 +00:00
Files
.github
_data
_drafts
_includes
_layouts
_news
_plugins
LICENSE
author_permalink.rb
hook-add-last-modified-date.rb
humanize.rb
_posts
_publishers
_repo
about
alternatives
assets
extend
use
.gitignore
404.md
CNAME
Gemfile
Gemfile.lock
LICENSE
README.md
_config.yml
blog.html
categories.html
contribute.md
demo.md
deploy.md
digitalocean.md
functions.md
index.md
news.html
newsletter.md
package-lock.json
package.json
plugins.html
postcss.config.js
publishers.html
support.md
tags.html
tailwind.config.js
inventree-website/_plugins/hook-add-last-modified-date.rb
2023-01-23 13:41:00 +01:00

22 lines
577 B
Ruby

# see https://stackoverflow.com/a/36769049/17860466
Jekyll::Hooks.register :posts, :pre_render do |post|
# get the current post last modified time
modification_time = File.mtime( post.path )
# inject modification_time in post's datas.
post.data['last-modified-date'] = modification_time
end
Jekyll::Hooks.register :repo, :pre_render do |repo|
# get the current post last modified time
modification_time = File.mtime( repo.path )
# inject modification_time in post's datas.
repo.data['last-modified-date'] = modification_time
end