我在本地创建了一个 Jekyll 网站。它与“bundle exec jekyllserve”配合良好。
但是经过以下操作后,我的网站无法正确将markdown和liquid代码转换为html。
这就是我在项目中安装“github-pages”的方式。
- 在 Gemfile 中添加“gem "github-pages", group: :jekyll_plugins",
- “sudo bundle 安装 && sudo bundle 更新”
添加 github-pages 插件并运行“bundle exec jekyllserve”后
无法正确转换 Markdown block 。谁能帮我解决这个问题,我真的很感激。 这是我的 jekyll 网站 code repos
最佳答案
我已经解决了这个问题。在本地 Jekyll 网站中,{{ page.content }} 被识别为“markdown + Liquid”代码片段。
不知何故,Github-pages 无法识别 {{ page.content }} 中的 markdown 部分,我们需要使用过滤器明确告诉 Gitpages {{ page.content }} 中存在 markdown 代码片段。强>
{{ page.content | markdownify | liquify }}
关于html - Jekyll网站无法使用 "github-pages"Jekyll插件正确将markdown和liquid转换为html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62524875/