我在jekyll中发布的帖子模板呈现了Google幻灯片或jupyter笔记本html的演示文稿。为此,我使用如下所示的markdown结构:
---
layout: post
title: title
date: 2018-10-28 00:00:00 -0500
categories: category
author: author
medium: jupyter
link: [//]: # (Here I insert the presentation url)
lang: en
---
<div>
{% if page.medium == 'jupyter' %}
{% include jupyter.html link=page.link %}
{% elsif page.medium == 'gslides' %}
{% include gslides.html link=page.link %}
{% else %}
{% include nodata.html %}
{% endif %}
</div>
这将产生所需的结果。但是,在创建包时,jekyll为每个帖子文件输出此错误:
Error: A Liquid tag in the excerpt of ./file.markdown couldn't be parsed.
Error: could not read file ./file.markdown: undefined method `ancestors' for nil:NilClass
我已经在寻找与此文件以及其他文件一起出现的语法错误,一切似乎都还可以。有人遇到过类似的问题吗?
编辑:我已经使用了语句的elif和else子句,只有这样问题才停止。