Jekyll on Github pages: any way to add footnotes to Markdown?

I recently switched to using Jekyll on Github pages for my various blogs, and I like that I can just push Markdown on Github and they handle the processing. I would like to continue to use it that way (instead of launching Jekyll locally and just clicking on the pre-generated site on Github), since the Github user interface makes it easy to add and configure messages if I'm not on my machine.

Here is just one thing I couldn’t understand: I cannot get Markdown footnotes to work. I use 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 found one message (somewhere) that suggested enabling the footnote extension for the redcarpet markdown processor, but that doesn’t:

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

Is it possible to use Markdown notes without first creating a static site before clicking it on Github?

+53
github-pages jekyll
Oct 20 '13 at 23:13
source share
3 answers

I use kramdown to parse markup, and it handles footnotes beautifully.

Change this line in the _config.yml file:

 markdown: redcarpet 

at

 markdown: kramdown 
+57
Oct 22 '13 at 1:32
source share

Starting with Jekyll 3.0.0, kramdown is the default Markdown processor , so the example in the OP question now works out of the box. The template is:

 Some text[^1]. Some other text[^2]. The identifier in the square brackets does not have to be numeric[^my_footnote]. [^1]: Some footnote. [^2]: Other footnote. [^my_footnote]: This also works fine. 
+12
Jan 14 '18 at 14:25
source share

Redcarpet

If you want to use redcarpet , there seems to be no convenient solution right now. Although Redcarpet 3 supports footnotes using the syntax you used, it is not included in Jekyll because Redcarpet 3 removes compatibility with Ruby 1.8 ( source ).

Solution 1: use a Redcarpet 2 plug

See this solution from Jerod Santo:

Add a file named Gemfile to the root of your Jekyll folder with this content:

 source "https://rubygems.org" gem "jekyll" gem "redcarpet", github: "triplecanopy/redcarpet" 

or alternatively djui/redcarpet

Then configure _config.yml to

 markdown: redcarpet redcarpet: extensions: [footnotes] 

Solution 2: Jekyll plug and includes Redcarpet 3

I do not know that this is the easiest way to do this. Comments are welcome.

Maruku

It seems to support footnotes ( source , source ).

+7
Jan 21 '14 at 18:26
source share



All Articles