benbalter / jekyll-remote-theme

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

Support for custom files is not working #100

Open djhoese opened 1 year ago

djhoese commented 1 year ago

Describe the bug

I have a GitHub Pages project (https://github.com/pytroll/pytroll.github.io) which due to some limitations of GitHub Pages I was pulling in the minima theme from github instead of the one officially supported by github pages (at least this is what I remember about doing it). I also customized the theme by having a _layouts/default.html, an _includes/anchor_support.html, and a assets/css/style.scss to add anchor symbols to the left of sections (h2 tags) using the anchor-js library.

I noticed recently that the anchors were no longer appearing. After diving in a bit I noticed that the javascript wasn't even being loaded and that my custom changes were being ignored completely. What I discovered (or at least got to work) was that the minima theme's home.html and page.html template were pulling/including the theme's default.html and not my custom _layouts/default.html. After copying home and page to my own directory things seem to be working.

Steps to reproduce the behavior

  1. See https://github.com/pytroll/pytroll.github.io/pull/46 for more details.
  2. Download/clone https://github.com/pytroll/pytroll.github.io/tree/2186e32cbc704d6678c8c67db3b12c959333d992
  3. Build the site (bundle install, bundle exec jekyll serve)
  4. Open the site, view source, and notice that anchor.min.js is never included as specified in anchor_support.html.

Copying https://github.com/jekyll/minima/blob/master/_layouts/home.html and https://github.com/jekyll/minima/blob/master/_layouts/page.html to _layouts and things should work.

Expected behavior

Custom local theme files override remote theme files.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

If this is not expected to work then I'm sorry I missed it in the README.