Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use a Markdown file in a GitHub page?

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?

like image 526
Gelin Luo Avatar asked Feb 27 '13 23:02

Gelin Luo


People also ask

Where can I host a markdown file?

Github Pages allow you to host static markdown/web pages (HTML and JS) for free.

How do I create a markdown page in GitHub?

Just create a new repository on GitHub, commit the Markdown files, and enable the GitHub Pages feature. GitHub Pages uses the Jekyll static site generator to create your website, and the Markdown support is excellent.

What is a markdown file in GitHub?

GitHub Markdown is the markup language for user content at GitHub and allows users at all skill levels to write plain text documents, which get rendered in HTML.

Is GitHub using markdown?

GitHub Flavored Markdown, often shortened as GFM, is the dialect of Markdown that is currently supported for user content on GitHub.com and GitHub Enterprise. This formal specification, based on the CommonMark Spec, defines the syntax and semantics of this dialect. GFM is a strict superset of CommonMark.


2 Answers

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

like image 190
Eevee Avatar answered Oct 05 '22 11:10

Eevee


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.

like image 32
Steven R. Loomis Avatar answered Oct 05 '22 11:10

Steven R. Loomis