gpt4 book ai didi

yaml - 在 yaml front-matter 中包含 markdown

转载 作者:行者123 更新时间:2023-12-03 10:38:04 32 4
gpt4 key购买 nike

我的一个网页需要包含多行项目(图像、标题、描述)。描述必须接受 Markdown 。我还没有在 Jekyll 中找到没有插件或创建多个文件的任何方法来做到这一点,每个文件一个。

另一个要求是该站点由 Github Pages 构建。 .即:没有 Jekyll 插件,Redcarpet Markdown 。

理想情况下,我希望创建一个 Jekyll 数据文件 (_data/products.yml),其中包含类似于下面的结构。请注意,说明包含 Markdown 列表和格式。

- Name: Company A
Year: 2005
Description: >
I was responsible for the following:
- Review of contracts
- Hiring
- Accounting

- Name: Company B
Year: 2010
Description: >
My role included **supervising** the marketing team and leading **publicity**.

我看到的另一个选择是将 Front-matter 与上述信息一起使用。它稍微麻烦一些,因为它将数据与特定页面(例如:work-experience.md)联系起来。

我已经尝试了上述各种变体,但格式从未转换为 HTML。如何处理?

最佳答案

如果您不想使用插件,我相信最好的办法是将它放在 _data 中。虽然不确定它是否是有效的 YAML,甚至有效的 YAML 是 _data 内容的要求。

您是否尝试过使用 markdownify功能如
{{ site.data.products.description | markdownify }}
http://jekyllrb.com/docs/templates/

关于yaml - 在 yaml front-matter 中包含 markdown,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21793753/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com