benbalter / jekyll-remote-theme

Jekyll plugin for building Jekyll sites with any GitHub-hosted theme
MIT License
288 stars 76 forks source link

Theme updates not reflected on GitHub Pages #16

Closed mmistakes closed 6 years ago

mmistakes commented 6 years ago

Not exactly sure what's at fault here, the plugin or some sort of caching on GitHub Pages.

I recently pushed some updates to my theme Minimal Mistakes, version 4.8.0. For whatever reason changes made to layouts like default.html aren't being applied to the pages hosted on GitHub Pages.

You can see this easily when comparing these lines in _layouts/default.html:

<!--
  Minimal Mistakes Jekyll Theme 4.8.0 by Michael Rose
  Copyright 2017 Michael Rose - mademistakes.com | @mmistakes
  Free for personal and commercial use under the MIT license
  https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE.txt
-->

Against the page source on GH Pages:

<!--
  Minimal Mistakes Jekyll Theme 4.7.0 by Michael Rose
  Copyright 2017 Michael Rose - mademistakes.com | @mmistakes
  Free for personal and commercial use under the MIT license
  https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE.txt
-->

It did the same thing when I pushed an update for version 4.7.1, but wasn't a big deal since the layouts themself didn't change. This release they did though, which is breaking a few things.

Post content and assets all updated fine with the files on master.

Thoughts?

mmistakes commented 6 years ago

Does jekyll-remote-theme handle versioned theme files? If I'm reading these lines correctly seems like if the theme files have been downloaded already they aren't downloaded again... even if they've changed.

def downloaded?
  @downloaded ||= theme_dir_exists? && !theme_dir_empty?
end
DirtyF commented 6 years ago

@mmistakes have you tried with the git ref remote_theme: mmistakes/minimal-mistakes@4.8.0?

Right now it seems that you have to ask specifically for a bump.

mmistakes commented 6 years ago

@DirtyF I tried referencing the most recent commit thinking that might force it and it made no difference.

I will give the tag a try now and see if that works...

mmistakes commented 6 years ago

@DirtyF same results with remote_theme: mmistakes/minimal-mistakes@4.8.0.

The strange thing is it pulls new CSS and JS assets I bundle in with the theme, but _layouts/default.html it doesn't seem to want to touch. My last release I made some changes to other layouts and those updated, so not sure if there's something weird with default due to inheriting other layouts or what.

benbalter commented 6 years ago

@mmistakes does your content repo (the one using the theme) have a default layout? GitHub Pages does no additional caching. The plugin itself caches within a build process (e.g., when the watch flag is enabled), but otherwise, each build command should build the site anew (and in the case of GitHub Pages, is in a fresh container so caching should be impossible). There may be some caching on the CDN layer, but requesting the theme version should break it.

mmistakes commented 6 years ago

@benbalter Wow! I feel like a complete idiot. When I migrated my /docs folder to use the remote theme plugin I didn't get all the layouts.

Removing that straggler _layouts/default.html fixes the issue. Sorry for the trouble :-(

mariomeissner commented 6 years ago

I'm facing a similar issue, I forked the mmistakes theme and added some modifications to the _includes/head.html (specifically, changing the location and url of the mathjax include). What do I have to do to force Github Pages to pull these changes?

Serving locally will work, but when I look at my online page, the changes are obviously not there. I have no layouts folder in my blog repo, just in the theme.

My repos are: https://github.com/mariomeissner/mariomeissner.github.io https://github.com/mariomeissner/minimal-mistakes

Do I have to change the version? How do I do that?

mmistakes commented 6 years ago

@mariomeissner I don't see _includes/head.html in your repo. Sure you pushed that?

screen shot 2018-08-16 at 6 57 42 am

mmistakes commented 6 years ago

@mariomeissner Ah I see what you did. You need to push some sort of commit to https://github.com/mariomeissner/mariomeissner.github.io to force a rebuild. It will pull the updated theme files then.

You can do a blank commit if you don't have actual content updates to push.

git commit --allow-empty -m "Force rebuild of site"
mariomeissner commented 6 years ago

Ah, that makes total sense. Thank you so much! <3 Issue solved :D

On Thu, 16 Aug 2018 at 13:01, Michael Rose notifications@github.com wrote:

@mariomeissner https://github.com/mariomeissner Ah I see what you did. You need to push some sort of commit to https://github.com/mariomeissner/mariomeissner.github.io to force a rebuild. It will pull the updated theme files then.

You can do a blank commit if you don't have actual content updates to push.

git commit --allow-empty -m "Force rebuild of site"

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/benbalter/jekyll-remote-theme/issues/16#issuecomment-413506921, or mute the thread https://github.com/notifications/unsubscribe-auth/AVYHR4lqjsWroNWlbBKBz-6tWJIha9Slks5uRVEDgaJpZM4Q5wJ0 .