chrisrhymes / bulma-clean-theme

A clean and modern Jekyll theme based on Bulma
http://www.csrhymes.com/bulma-clean-theme/
MIT License
383 stars 484 forks source link

bulma-clean-theme defaults to version 0.3 when run locally with github-pages gem #16

Closed risa2000 closed 5 years ago

risa2000 commented 5 years ago

I am facing a strange problem. I have been testing locally my site with bulma-clean-theme using this Gemfile:

source 'https://rubygems.org'
gem 'github-pages'
gem 'bulma-clean-theme'

Running bundle install resolves bulma-clean-theme to version 0.3. I am attaching the full Gemfile.lock here Gemfile.lock.txt. This file is from the Windows tests, but on Gentoo the file is basically the same, except it misses x64-mingw32 flavoring.

If I try to force the latest version of the theme in Gemfile:

source 'https://rubygems.org'
gem 'github-pages'
gem 'bulma-clean-theme', '0.5.6'

bundle update fails with some unresolved dependencies:

$ bundle update
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Bundler could not find compatible versions for gem "jekyll":
  In Gemfile:
    bulma-clean-theme (= 0.5.6) was resolved to 0.5.6, which depends on
      jekyll (~> 3.8)

    github-pages was resolved to 4, which depends on
      jekyll (= 1.1.2)

Bundler could not find compatible versions for gem "rouge":
  In Gemfile:
    bulma-clean-theme (= 0.5.6) was resolved to 0.5.6, which depends on
      rouge (~> 3.3)

    github-pages was resolved to 198, which depends on
      rouge (= 2.2.1)

Now, I have tried this on Windows and on Gentoo with almost the same results (Windows version gives also an unresolved dependency on ruby on top). But all those versions seem so ancient that I suspect there is some bug in the dependency definition.

So at the moment, I am running the theme locally with 0.3 version, but when I set the theme as remote-theme in a GitHub repo (https://risa2000.github.io/testpages/) it generates a page, which seems to be using the newer version of the theme because the layout (e.g. the footer section) corresponds to the newer version found in 0.5.6.

Now I am not sure, how to test the theme locally, and how to find out, which version is used when GitHub pages are generated directly from the repo.

I am also not sure, if this is a problem with the theme or github-pages gem, but would like to figure it out, so I could use the same version of the theme locally as the one which GitHub uses (and which github-pages gem is actually supposed to ensure).

Any ideas?

chrisrhymes commented 5 years ago

I would remove github-pages gem from your gemfile and try bundle update and see if it brings in the new version of the theme locally.

From what I remember, the github-pages gem uses a very old version of Jekyll and I was having issues building locally so I updated the version of Jekyll the theme depends on and it still worked ok locally and when deployed to github pages for my own website

Let me know if this resolves your issue.

risa2000 commented 5 years ago

I removed the github-pages gem from the Gemfile (left the theme only) and run bundle update:

D:\Work\site_dir>bundle update
Fetching gem metadata from https://rubygems.org/............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using public_suffix 4.0.1 (was 3.1.1)
Using addressable 2.7.0
Using colorator 1.1.0
Using eventmachine 1.2.7 (x64-mingw32)
Using http_parser.rb 0.6.0
Using em-websocket 0.5.1
Using concurrent-ruby 1.1.5
Using i18n 0.9.5
Using rb-fsevent 0.10.3
Using ffi 1.11.1 (x64-mingw32)
Using rb-inotify 0.10.0
Using sass-listen 4.0.0
Using sass 3.7.4
Using jekyll-sass-converter 1.5.2
Using ruby_dep 1.5.0
Using listen 3.1.5
Using jekyll-watch 2.2.1
Using kramdown 1.17.0
Using liquid 4.0.3 (was 4.0.0)
Using mercenary 0.3.6
Using forwardable-extended 2.6.0
Using pathutil 0.16.2
Using rouge 3.10.0 (was 2.2.1)
Using safe_yaml 1.0.5
Fetching jekyll 3.8.6 (was 3.8.5)
Installing jekyll 3.8.6 (was 3.8.5)
Fetching jekyll-feed 0.12.1 (was 0.11.0)
Installing jekyll-feed 0.12.1 (was 0.11.0)
Using jekyll-paginate 1.1.0
Using jekyll-seo-tag 2.6.1 (was 2.5.0)
Fetching jekyll-sitemap 1.3.1 (was 1.2.0)
Installing jekyll-sitemap 1.3.1 (was 1.2.0)
Using bulma-clean-theme 0.5.6 (was 0.3)
Using bundler 2.0.2
Bundle updated!

It seemed promising until I tried:

D:\Work\site_dir>bundle exec jekyll serve
Configuration file: D:/Work/site_dir/_config.yml
  Dependency Error: Yikes! It looks like you don't have jekyll-relative-links or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- jekyll-relative-links' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
jekyll 3.8.6 | Error:  jekyll-relative-links

I added jekyll-relative-links to Gemfile as well, did bundle update again , bundle exec jekyll serve and it seems to be running fine. I noticed that when I accidentally set the page style to default some styles did not apply, but I assume it is an intended behavior.

Anyway, I am thankful for your help, as I would probably not figure it out myself. I am now confused though, how to properly setup the environment for the tests. Should I first run bundle install with the github-pages gem in Gemfile to "build" Gemfile.lock and then remove it and run bundle update? Or should I simply start directly just with the theme (and the plugin) in Gemfile?

chrisrhymes commented 5 years ago

I don't think you need the github-pages gem for it to work with GitHub pages so I would remove it from your Gemfile and run bundle update to rebuild the Gemfile.lock. For the layout, you should set it to layout: page rather than default, as page extends default.

risa2000 commented 5 years ago

Yes, it seem so, though I originally installed jekyll-4.0.0 and with it had a bunch of dependencies pulled in, which did not go well with github-pages gem at all, so I got scared and did not want to experiment much ;). Anyway, thanks for the help and for merging my PR.