GitHub Pages 不识别 Liquid tag 构建失败

引言

这几天用 Markdown 写博客时,提交到 GitHub Pages 时,Jekyll 并没有生成对应的网页。很是奇怪。   我起初猜想是 GitHub 是不是抽风了。这样过了几天,今天新建空白 Markdown 文档提交后依然没有看到生成对应的网页。
到底是什么原因?

GitHub Page build failure

我想起我之前 GitHub Page build failure 会发邮件的,这个邮箱我没怎么登录使用。
登录进去,果然有 Page build failure 的提示邮件。如下:


The page build failed with the following error:

The tag `elif` on line 235 in `_posts/2016-07-02-SaltStack-systematic-learning-05-Grains-Pillar.md` 
is not a recognized Liquid tag. 
For more information, see https://help.github.com/articles/page-build-failed-unknown-tag-error.

For information on troubleshooting Jekyll see:

  https://help.github.com/articles/troubleshooting-jekyll-builds

If you have any questions you can contact us by replying to this email.

上面意思是说我写的那个 Markdown 文档中的 elif 不是一个可以识别的 Liquid 标签。


What is Liquid?

Liquid is an open-source template language created by Shopify and written in Ruby. 
It is the backbone of Shopify themes and is used to load dynamic content on storefronts.

Liquid has been in production use since June 2006 and is now used by many other hosted web applications.

elif 那段代码是关于 SaltStack 中使用 Jinaja2 模板的,和 Liquid 标签冲突了,代码如下:

Unrecognized-Liquid-tag

解决办法:我截图展示上面的代码了,不然造成这篇 Markdown 及之后的文档不能 build,造成引言中提到的问题。