Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Date shows locally but not on github pages #78

Open
AutumnEvans418 opened this issue May 8, 2020 · 6 comments
Open

Date shows locally but not on github pages #78

AutumnEvans418 opened this issue May 8, 2020 · 6 comments

Comments

@AutumnEvans418
Copy link

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
Copy link

mrdaliri commented Jul 4, 2020

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
Copy link

bcb commented Sep 15, 2021

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
Copy link

prenetic commented Mar 6, 2022

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.

#69 (comment)

@selimslab
Copy link

It works when you build with github actions

@bewuethr
Copy link

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.

y377 added a commit to y377/jekyll_better that referenced this issue Feb 14, 2023
njerig added a commit to njerig/njerig.github.io that referenced this issue Mar 6, 2024
@ldemailly
Copy link

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

bernhold added a commit to ideas-productivity/ideas-productivity.github.io that referenced this issue Jul 13, 2024
adding fetch-depth: 0 to checkout action, based on this comment: gjtorikian/jekyll-last-modified-at#78 (comment)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants