Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jekyll on Github Pages: any way to add footnotes in Markdown?

I've recently switched over to using Jekyll on Github Pages for my various blogs, and love that I can just push Markdown to Github and they handle the processing. I'd like to continue using it this way (rather than running Jekyll locally and just pushing the pre-generated site to Github), since the Github UI makes it easy to add and tweak posts if I'm not at my own machine.

There's just one thing I haven't been able to figure out: I can't get Markdown footnotes working. I'm using this style:

I bet you'd like more information about this sentence [^1].  [^1]: Well lucky for you, I've included more information in footnote form. 

I did find one post (somewhere) that suggested enabling a footnotes extension for the redcarpet markdown processor, but this doesn't do it either:

markdown: redcarpet redcarpet:   extensions: ["footnotes"] 

Is there any way to use Markdown footnotes without pre-generating the static site before pushing it to Github?

like image 538
Brock Boland Avatar asked Oct 20 '13 23:10

Brock Boland


People also ask

How do you add a footnote in Markdown?

To create a footnote reference, add a caret and an identifier inside brackets ( [^1] ). Identifiers can be numbers or words, but they can't contain spaces or tabs. Identifiers only correlate the footnote reference with the footnote itself — in the output, footnotes are numbered sequentially.

Does Jekyll support Markdown?

By default, Jekyll uses the kramdown Markdown processor with stock settings, but you can enable other kramdown options or even switch Jekyll to another Markdown processor. See the Jekyll Markdown configuration options documentation for more information.

Do I have to use Jekyll with GitHub Pages?

So it turns out the answer is that you can use jekyll source code, but only if it's in the gh-pages branch. If you use the docs/ folder or the master branch, it seems that you need to build locally before pushing (these options just allow you to host compiled HTML files rather than the raw jekyll source files).

How does GitHub Pages work with Jekyll?

Your site is automatically generated by GitHub Pages when you push your source files. Note that GitHub Pages works equally well for regular HTML content, simply because Jekyll treats files without front matter as static assets. So if you only need to push generated HTML, you're good to go without any further setup.


1 Answers

I use kramdown for markdown parsing and it handles footnotes nicely.

Change this line in your _config.yml file:

markdown: redcarpet 

to:

markdown: kramdown 
like image 194
Brian Willis Avatar answered Sep 19 '22 13:09

Brian Willis