can't get jekyll to parse markdown

╄→尐↘猪︶ㄣ 提交于 2019-12-25 02:38:11

问题


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

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.

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

Here is what my directory structure looks like:

├── _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

and in _posts I have a post that ends with .md


回答1:


I have figured out the issue. It boils down to using these handlebars to render content:

{{ content }}

rather than these

{{ page.content }}

...which is confusing, because the only way to access other page variables is with the page namespace:

{{ page.blurb }}


来源:https://stackoverflow.com/questions/22275429/cant-get-jekyll-to-parse-markdown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!