【发布时间】:2018-11-01 05:09:09
【问题描述】:
由于 Jekyll-Scholar 在 Github 页面上不可用,我正在尝试找到一种解决方法来获得某种参考书目功能,使用 kramdown 脚注和包含。我想留在 Github Pages 工作流程中,而不是在本地编译网站。
我有一个集合,其中包含 _data/biblio.yaml 中的所有引用:
- authors: Me, Her and Him
title: A Serious Article
key: ref1
在page1.md 我有:
This is a sentence with a citation[^1]
[^1]:
{% include citation.html key="ref1" %}
在_includes/citation.html 我有一个引用模板:
{% assign citation = site.data.biblio | where:"key", include.key | first %}
<span class="cit-authors">{{citation.authors}}</span>, <span class="cit-title">{{citation.title}}</span>
这是行不通的,因为在编译后引用是在 before 而不是 inside 脚注定义中呈现的:
<p>
<span class="cit-authors">Me, Her and Him</span>, <span class="cit-title">A Serious Article</span>
</p>
<div class="footnotes">
<ol>
<li id="fn:1">
<p><a href="#fnref:1" class="reversefootnote">↩</a></p>
</li>
</ol>
</div>
想要的结果显然是在 <li> 块中包含包含的内容。
这不起作用有什么原因吗?有没有办法让它按需要工作?
【问题讨论】:
标签: jekyll github-pages