problem with minima/github/custom-style
phpeterson-usf opened this issue · 5 comments
This is probably a question more than a defect, but I'm confused about how minima uses custom-style.scss
- I made a repo for a template site based on minima, and used custom-style.scss (green site header)
- In my Gemfile I specified to get minima from your repo, assuming that I need minima 3.0 to get the refactored style features.
- This works fine in the template repo, both on locally and on Github Pages
- Then I created another repo based on my template repo.
- It contains the same Gemfile and _config.yml specifications of minima, and the same .github workflow to build the site
- When I run the site locally, I get the custom-styles, but on Github Pages I do not get the custom-styles
Do I need to do something else in the Gemfile to get a version of minima which uses custom-style.scss?
BTW, both Github Pages builds (parent and child site) say they're doing this:
Using minima 2.5.1 from https://github.com/jekyll/minima.git (at master@7a326eb)
but on Github Pages I do not get the custom-styles
GitHub Pages is a closed environment.
It does not take a Gemfile into consideration. Everything is managed via the config file.
(Unless.. you are using just GitHub Actions to build and deploy).
To force GitHub Pages to use Minima 3.0, you need to use the remote_theme feature,
For GitHub Pages, update your config file:
- theme: minima
+ remote_theme: "jekyll/minima@commit_sha_or_branch" # Simple "jekyll/minima" is fine as well.
The following is only FYI
Based on the log of your child-site's workflow run:
Logging at level: debug
Configuration file: /github/workspace/./_config.yml
Theme: minima
Theme source: /usr/local/bundle/gems/minima-2.5.1
GitHub Pages: github-pages v222
GitHub Pages: jekyll v3.9.0
Theme: minima
Theme source: /usr/local/bundle/gems/minima-2.5.1
None of those reflect what's listed in your child-site's Gemfile.lock
So, either you have configured GitHub Pages to build your child-site in the repo settings or the third-party action needs to be studied closely..
After digging a bit further, I learned that GitHub recently switched to using GitHub Actions natively to build and deploy Jekyll sites.
Judging from your child-site's workflow logs, my guess is that you have configured the child-repo's default branch to be built by GitHub Pages.
If that is indeed so I recommend that you change the repo settings to have GitHub Pages deploy gh-pages
instead of the default branch.
Oh shoot, thanks for pointing out gh-pages
. I also changed the _config.yml to get minima from the commit hash (tried "@ master" too). However, now the build workflow throws errors on head.html
and post.html
, which it should find in minima's _includes
.
Is this "remote-theme" approach the correct way to include minima? The Liquid exception implies that I have to have minima in my repo. I guess I could copy it in but that seems like a bummer for modularity.
Jekyll Feed: Generating feed for posts
Build Warning: Layout 'post' requested in _posts/2021-12-01-lecture.markdown does not exist.
Build Warning: Layout 'post' requested in _posts/2021-12-02-lecture.markdown does not exist.
Liquid Exception: Could not locate the included file 'head.html' in any of ["/github/workspace/_includes"].
Ensure it exists in one of those directories and, if it is a symlink, does not point outside your site source. in
/github/workspace/_layouts/default.html
------------------------------------------------
Jekyll 4.2.1 Please append `--trace` to the `build` command
for any additional information or backtrace.
------------------------------------------------
Similar issues jekyll/jekyll#5216 jekyll/jekyll#6712 don't seem to help, though I see you suggesting the copy approach.
However, now the build workflow throws errors on
head.html
andpost.html
, which it should find in minima's_includes
.
The error is in your config file.
Your directive is entirely wrong. It should be:
- remote-theme: minima@7a326eb
+ remote_theme: jekyll/minima@7a326eb
Please compare the two lines and understand what went wrong..
Understood. Thanks for your help.