简体   繁体   中英

How to update Jekyll's dependencies in GitHub

I have a Jekyll blog at GitHub, and there are problems caused by an old version of the Rouge syntax highlighter. The issue can be seen in this post here 1 , for example. Note the red equals signs.

If I serve my site locally, I get the latest version of Rouge and I don't see those red equals signs (actually, I wrote the patch to fix that bug and my patch was released in Rouge 3.3.0). So that's how I know the dependencies are out of date on the GitHub side.

I have found loads of posts about how to update dependencies locally, but how can I update them in GitHub?


1 Thanks to an answer that was subsequently deleted, I was able to fix the red highlighting by using the JS syntax highlighter.

With some help from GitHub support, I have an answer to this finally.

The procedure is basically:

Create a Gemfile:

source 'https://rubygems.org'
gem 'github-pages', group: :jekyll_plugins

Install the bundle:

▶ bundle install

Build and serve the site locally:

▶ bundle exec jekyll serve

The site should then be available for preview at: http://127.0.0.1:4000/

Here's where it gets tricky.

Once you've built your site, you'll need to push the contents of the _site folder up to GitHub, but to the root of the master branch, replacing your existing source code.

Thus, it is recommended to firstly create a new branch eg develop where the blog source code can live. This develop branch can then be used to edit the site, and then the built contents can be pushed to the master branch when ready.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM