我正在尝试找到一种方法来选择性地在内容中的某处选择摘录,即能够定义摘录的起点和终点。
我已经尝试过Eleventy 的 docs方法来解析内容的摘录。但这会解析分隔符 <!-- excerpt --> 之上的所有内容。
选择使用{{ post.data.page.excerpt }}
---
pageTitle: blog
tags: posts
---
Everything here is parsed as the excerpt
<!-- excerpt -->
Lorem ipsum, dolor sit amet consectetur adipisicing elit.
...
我尝试的另一种方法是在前面使用一个键来单独指定介绍/摘录,但是这种方法不允许我使用现有内容。
{{ post.data.intro }}
---
pageTitle: blog
tags: posts
intro: This is an excerpt stored in a key
---
Lorem ipsum, dolor sit amet consectetur adipisicing elit.
...
目前有没有办法为要从内容中提取的摘录指定开始和结束分隔符?例如:
---
pageTitle: blog
tags: posts
---
#Heading of the blog
Lorem ipsum, dolor sit amet consectetur adipisicing elit...
<!-- excerptStart -->
This part should be the excerpt of the post
<!-- excerptEnd -->
...
任何帮助,将不胜感激!