Can I use a Markdown file in a GitHub page?

2020-06-09 07:02发布

Since the GitHub wiki does not support directories, I want to put my md files into GitHub pages. However when I open them I found they are not interpreted at all. GitHub just gives me the raw file. See http://greenlaw110.github.com/Rythm/en/index.md. Any idea?

1条回答
劳资没心,怎么记你
2楼-- · 2020-06-09 07:20

The documentation isn't particularly clear on this, but given that the Markdown rendering is done by Jekyll, I believe you need what they call "YAML front matter" for it to compile the page. So try putting this at the top of your file:

---
title: Document Center
---

That should be enough to trigger Jekyll. (And then you can get fancy and start using layouts, etc.)

查看更多
登录 后发表回答