gjtorikian / jekyll-last-modified-at

A Jekyll plugin to show the last_modified_at time of a post.
MIT License
241 stars 38 forks source link

Date shows locally but not on github pages #78

Open chrisevans9629 opened 4 years ago

chrisevans9629 commented 4 years ago

When I am running locally, I correctly see the date at the bottom of the page, but when I publish it on github pages, it's completely blank:

image

my default.html layout:

<div class="col"><p>Last Modified at {{ page.last_modified_at | date: '%-d %B %Y %r' }}</p></div>

my config:

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'

my gem:

# frozen_string_literal: true

source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

# gem "rails"
gem 'jekyll', '~> 4.0'

group :jekyll_plugins do
    gem "jekyll-last-modified-at"
  end
mrdaliri commented 4 years ago

Hi @chrisevans9629, GitHub pages supports a fairly limited number of plugins due to security reasons, so users cannot use 3rd-party plugins such as this one.

You can consider Netlify which gives you a lot of more options, or build your website locally and push only the _site folder to your Github pages branch.

bcb commented 2 years ago

I'm also having this issue on Github Pages, and my site is built with Github Actions so there should be no limit to which plugins can be used.

"You can use any Jekyll plugins irrespective of them being on the supported versions list" —link.

prenetic commented 2 years ago

I ran into a similar issue on CloudFlare Pages recently. If the GitHub Pages platform is anything like Cloudflare Pages, this could be a shortcoming inherent to many static site generation platforms.

https://github.com/gjtorikian/jekyll-last-modified-at/issues/69#issuecomment-1059857852

selimslab commented 1 year ago

It works when you build with github actions

bewuethr commented 1 year ago

Just commented over here, but tl;dr: if you build the page yourself with Actions, you can try fetch-depth: 0 on the checkout so there isn't just one commit to get the time from.

ldemailly commented 2 weeks ago

I put my comment in the other ticket, so repeating here in case it helps someone:

if anyone is interested, this made it finally work: https://github.com/ldemailly/laurentsv/blob/master/.github/workflows/jekyll-gh-pages.yml