无法让jekyll解析markdown [英] can't get jekyll to parse markdown
问题描述
当我在Jekyll项目中包含扩展名为.md
的文件时,降价会显示为纯文本,完全未格式化,部署到我的目标github页面上以及本地
When I include a file with the .md
extension in my Jekyll project, the markdown just shows up as plain text, totally unformatted, when deployed to github pages which is my target, and locally.
我认为我忠实地遵循了这些指南中的指示,但是一定错过了一些事情:
I think I have faithfully followed the directions in these guides, but must have missed something:
- http://jekyllrb.com/docs/configuration/
- https://help.github.com/articles/using-jekyll-with-pages
我试图在_config.yml中不包括 any markdown指令,以为jekyll仍然知道该怎么做.出于无奈,我开始添加指令.结果始终完全相同:未格式化的降价显示为纯文本.
I have tried not including any markdown directives in _config.yml, thinking that jekyll would know what to do anyway. Out of frustration I started adding directives. The result is always exactly the same: unformatted markdown appearing as plain text.
这是我的_config.yml:
Here's my _config.yml:
markdown: kramdown
markdown_ext: md
kramdown:
input: GFM
kramdown:
auto_ids: true
footnote_nr: 1
entity_output: as_char
toc_levels: 1..6
exclude: ['myblog.sublime-project','myblog.sublime-workspace']
safe: true
lsi: false
pygments: true
source: .
title: My blog Title
tagline: Some little witty quirky phrase
这是我的目录结构:
├── _data
├── _drafts
├── _includes
├── _layouts
├── _posts
├── _site
│ ├── 2011
│ │ └── 01
│ │ └── 02
│ ├── 2014
│ │ ├── 02
│ │ │ └── 15
│ │ └── 03
│ │ ├── 03
│ │ └── 07
│ ├── assets
│ │ ├── css
│ │ ├── images
│ │ └── js
│ └── images
├── assets
│ ├── css
│ ├── images
│ └── js
└── images
,在_posts
中,我有一条以.md
推荐答案
我已经解决了这个问题.归结为使用这些把手来呈现内容:
I have figured out the issue. It boils down to using these handlebars to render content:
{{ content }}
而不是这些
{{ page.content }}
...这很令人困惑,因为访问其他页面变量的唯一方法是使用 和page
命名空间:
...which is confusing, because the only way to access other page variables is with the page
namespace:
{{ page.blurb }}
这篇关于无法让jekyll解析markdown的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!