Search code examples
jekyllgithub-pageskatex

My Liquid tag is not recognized by GitHub pages


I used Jekyll 3.8.5 and built a blog on GitHub. I also used Jekyll-Katex 0.3.0, a Jekyll plugin for easy server-side math rendering via KaTeX. Everything works fine on my local machine. But when I pushed it to GitHub, I got this: "Your site is having problems building: The tag Katexmm on line 11 in _posts/2019-01-22-ECDSA-and-Bitcoin-I.md is not a recognized Liquid tag."

"Katexmm" is a liquid tag of Jekyll-Katex, so I checked dependencies. Jekyll-Katex 0.3.0 requires Jekyll ~> 3.8 while GitHub Pages uses Jekyll 3.7.4. I guess that's the problem.

What shall I do? One more thing: I want to use "katexmm", please don't suggest me to use Jekyll 3.7.4 instead of 3.8.5. Thanks in advance.

I followed ashmaroli's suggestion, but still doesn't work. I tried Nelify and "Deploy failed":

11:31:01 AM: Build ready to start
11:31:03 AM: build-image version: 84aca9ba39e0ee86ba194760fbfc51a808f62543
11:31:04 AM: buildbot version: 57d44fd1631cc3fff8b38fbaf88d3d04f946418a
11:31:04 AM: Fetching cached dependencies
11:31:04 AM: Starting to download cache of 254.7KB
11:31:04 AM: Finished downloading cache in 147.184771ms
11:31:04 AM: Starting to extract cache
11:31:04 AM: Failed to fetch cache, continuing with build
11:31:04 AM: Starting to prepare the repo for build
11:31:04 AM: No cached dependencies found. Cloning fresh repo
11:31:04 AM: git clone https://github.com/Jun-Wang-2018/Blog
11:31:05 AM: Preparing Git Reference refs/heads/gh-pages
11:31:06 AM: Starting build script
11:31:06 AM: Installing dependencies
11:31:08 AM: Downloading and installing node v8.15.0...
11:31:08 AM: Downloading https://nodejs.org/dist/v8.15.0/node-v8.15.0-linux-x64.tar.xz...
11:31:08 AM:      0.0%
11:31:08 AM: 
######
11:31:08 AM:                    8.4%
11:31:08 AM: 
#############################################
11:31:08 AM: ###                          66.8%
11:31:08 AM: 
######################################
11:31:08 AM: ################################## 100.0%
11:31:08 AM: Computing checksum with sha256sum
11:31:08 AM: Checksums matched!
11:31:11 AM: Now using node v8.15.0 (npm v6.4.1)
11:31:12 AM: Attempting ruby version 2.3.6, read from environment
11:31:13 AM: Using ruby version 2.3.6
11:31:15 AM: Using PHP version 5.6
11:31:15 AM: Started restoring cached ruby gems
11:31:15 AM: Finished restoring cached ruby gems
11:31:15 AM: Installing gem bundle
11:31:15 AM: You must use Bundler 2 or greater with this lockfile.
11:31:15 AM: Error during gem install
11:31:15 AM: Error running command: Build script returned non-zero exit code: 1
11:31:15 AM: Failing build: Failed to build site
11:31:15 AM: failed during stage 'building site': Build script returned non-zero exit code: 1
11:31:15 AM: Finished processing build request in 11.629358799s

I tried Cloudcannon and "Jekyll build failed":

Syncing raw files... done
Checking existing local bundle state... failed
Loading gem cache... 
Checking gem cache (bundle_cache/A16MrNFnrU9wWPnsPr5G8PkR_kBFEHG0ytrPjGtZ7mQ.zip)... no cache

$ export JEKYLL_ENV="production"

$ ruby -v

ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]

$ bundle -v

Bundler version 1.16.6

$ bundle config --global jobs 4

Configured concurrent installs!

$ bundle install

Using local cacheable path...
You must use Bundler 2 or greater with this lockfile.


Solution

  • My problem is solved, FINALLY. I used another static generator Hexo with an amazing theme "Next" and it works fine with KaTeX.

    My site snapshot

    My site

    Two main steps to solve the problem:

    Step 1. Install Hexo and deploy my site to GitHub

    Step 2. Embed KaTex

    There are some details in each step. I wrote two posts: Step 1, Step 2.