首页 > 解决方案 > GitHub 页面无法识别我的 Liquid 标签

问题描述

我使用 Jekyll 3.8.5 并在 GitHub 上建立了一个博客。我还使用了Jekyll-Katex 0.3.0,这是一个 Jekyll 插件,用于通过 KaTeX 轻松进行服务器端数学渲染。在我的本地机器上一切正常。但是当我将它推送到 GitHub 时,我得到了这样的信息:“您的网站在构建时遇到问题:_posts/2019-01-22-ECDSA-and-Bitcoin-I.md 中第 11 行的标签 Katexmm 不是公认的 Liquid 标签。”

"Katexmm" 是Jekyll-Katex 的液体标签,所以我检查了依赖项。Jekyll-Katex 0.3.0 需要 Jekyll ~> 3.8GitHub Pages 使用 Jekyll 3.7.4。我想这就是问题所在。

我该怎么办?还有一件事:我想使用“katexmm”,请不要建议我使用 Jekyll 3.7.4 而不是 3.8.5。提前致谢。

我遵循了 ashmaroli 的建议,但仍然无法正常工作。我尝试了 Nelify 并“部署失败”:

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

我试过 Cloudcannon 和“Jekyll 构建失败”:

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.

标签: jekyllgithub-pageskatex

解决方案


我的问题终于解决了。我使用了另一个具有惊人主题“Next”的静态生成器 Hexo,它与 KaTeX 配合得很好。

我的站点快照

我的网站

解决问题的两个主要步骤:

步骤 1. 安装 Hexo 并将我的站点部署到 GitHub

步骤 2. 嵌入 KaTex

每一步都有一些细节。我写了两个帖子: Step 1Step 2


推荐阅读