Can I use a Markdown file in a GitHub page?

后端 未结 2 539
感情败类
感情败类 2021-02-13 18:57

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 gi

相关标签:
2条回答
  • 2021-02-13 19:36

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

    0 讨论(0)
  • 2021-02-13 19:41

    Another reason (found by experience) why you might get a raw index.md file, is if you happen to also have a similarly-named index.html file. This blocks GH Pages.

    Deleting index.html produces (on the site) a new index.html with parsed markdown. The original index.md is then no longer accessible.

    0 讨论(0)
提交回复
热议问题