我正在使用markdown文件的YAML标题,在博客文章中添加excerpt
变量,以便我可以在其他地方使用它。其中一个摘录中,我通过markdown链接标记引用了早期的博客文章,并且我使用了liquid模板数据变量{{ site.url }}
代替站点的基本URL。
因此,我有类似于以下内容(已经削减了一些):
---
title: "Decluttering ordination plots in vegan part 2: orditorp()"
status: publish
layout: post
published: true
tags:
- tag1
- tag2
excerpt: In the [earlier post in this series]({{ site.url }}/2013/01/12/
decluttering-ordination-plots-in-vegan-part-1-ordilabel/ "Decluttering ordination
plots in vegan part 1: ordilabel()") I looked at the `ordilabel()` function
----
然而,Jekyll和Maruku Markdown解析器不支持此操作,这使我怀疑是否可以在YAML头文件中使用Liquid标记。
在Jekyll处理的页面的YAML头文件中使用Liquid标记是可能的吗?
- 如果可以,在示例中我做错了什么?
- 如果不允许,我该如何实现我想要的效果?我目前正在我的笔记本上开发网站,不想将基础URL硬编码,因为当我准备部署时,它将不得不更改。
我从Maruku那里收到的错误信息是:
| Maruku tells you:
+---------------------------------------------------------------------------
| Must quote title
| ---------------------------------------------------------------------------
| the [earlier post in this series]({{ site.url }}/2013/01/12/decluttering-o
| --------------------------------------|-------------------------------------
| +--- Byte 40
和
| Maruku tells you:
+---------------------------------------------------------------------------
| Unclosed link
| ---------------------------------------------------------------------------
| the [earlier post in this series]({{ site.url }}/2013/01/12/decluttering-or
| --------------------------------------|-------------------------------------
| +--- Byte 41
和
| Maruku tells you:
+---------------------------------------------------------------------------
| No closing ): I will not create the link for ["earlier post in this series"]
| ---------------------------------------------------------------------------
| the [earlier post in this series]({{ site.url }}/2013/01/12/decluttering-or
| --------------------------------------|-------------------------------------
| +--- Byte 41
excerpt
值包含了冒号(:
)。如果一个值包含冒号,那么在YAML中应该将该值用引号括起来。 - mipadi