html - Jekyll网站无法使用 "github-pages"Jekyll插件正确将markdown和liquid转换为html

标签 html markdown jekyll github-pages liquid

我在本地创建了一个 Jekyll 网站。它与“bundle exec jekyllserve”配合良好。

但是经过以下操作后,我的网站无法正确将markdown和liquid代码转换为html。

这就是我在项目中安装“github-pages”的方式。

  1. 在 Gemfile 中添加“gem "github-pages", group: :jekyll_plugins",
  2. “sudo bundle 安装 && sudo bundle 更新”

添加 github-pages 插件之前 enter image description here

添加 github-pages 插件并运行“bundle exec jekyllserve”后 enter image description here

无法正确转换 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/

相关文章:

markdown - 美人鱼 - 如何在 Markdown 中连接子图?

r - 在 R Markdown 中为代码块添加换行符

javascript - 用于将 HTML 转换为 Markdown 的 Jquery 插件

jekyll - GitHub 页面尾部斜杠

javascript - 如何将 `appendPre` 放入表中?

c# - 如何修改使用asp :Content to css-page?的asp.net页面的样式

javascript - 我怎样才能用 Jekyll 做一个预加载页面?

html - 自动为图片标签添加宽高属性

html - 边距折叠,css

html - 百分比宽度和 1px 边框