Can I use a Markdown file in a GitHub page?

2020-06-09 06:36发布

问题:

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:

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.)