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

后端 未结 3 1318
别那么骄傲
别那么骄傲 2021-01-30 12:34

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

3条回答
  •  一整个雨季
    2021-01-30 13:17

    Redcarpet

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

    Solution 1: Use forked Redcarpet 2

    See this solution by Jerod Santo:

    Add a file called 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

    Theny adjust your _config.yml to

    markdown: redcarpet
    redcarpet:
      extensions: [footnotes]
    

    Solution 2: Fork Jekyll and include Redcarpet 3

    I don't know what's the easiest way to do this. Comments are welcome.

    Maruku

    Seems to support footnotes (source, source).

提交回复
热议问题