hugo-footnotes-popup icon indicating copy to clipboard operation
hugo-footnotes-popup copied to clipboard

Include instructions for multi-line footnotes

Open trosel opened this issue 5 years ago • 3 comments

I can see that it works with them, but I don't know how the indentation is parsed. Can I have markdown lists inside a footnote?

trosel avatar Jul 26 '19 13:07 trosel

Hello, I have tested this right now with markdown copied from here. You need to indent all lines to make them stay inside the footnote. So, yes, you can have lists inside footnotes.

Minor change is that multi-paragraph footnote will be wrapped inside p tag (this is probably because of markdown parsing). This might add padding to the footnote and indentation will not be the same. I think that wrapping regular single-line footnotes in p tag would "fix" this (make them look same).

Faster fix would be to remove padding from p tag inside footnotes in CSS.

vaetas avatar Jul 26 '19 13:07 vaetas

I can confirm that lists, and also multiple paragraphs inside one footnote work fine. At least with kramdown (as used with Jekyll). But it shouldn’t be a problem with other Markdown flavors either.

Example here: http://static.jekyll.dflect.net/CSS-Test/ (The first footnote is after “Heading 3”, the second one after “Heading 4”.)

tflo avatar Jul 26 '19 22:07 tflo

Multi-line footnotes works out of box in Hugo:

[^1]: Ugh pinterest fixie cronut pitchfork beard. Literally deep
      cold-pressed distillery pabst austin.
      
      Typewriter 90's roof party poutine, kickstarter raw
      denim pabst readymade biodiesel umami chicharrones XOXO.

It also works well with lists:

[^1]: Ugh pinterest fixie cronut pitchfork beard. Literally deep
      cold-pressed distillery pabst austin.

      - On a windy day let's go flying
      - There may be no trees to rest on
      - There may be no clouds to ride
      - But we'll have our wings and the wind will be with us
      - That's enough for me, that's enough for me.

In addition, there is the possibility to force break strings into separate lines, for example for poetry footnotes:

[^1]: Ugh pinterest fixie cronut pitchfork beard. Literally deep
      cold-pressed distillery pabst austin.

      On a windy day let's go flying\
      There may be no trees to rest on\
      There may be no clouds to ride\
      But we'll have our wings and the wind will be with us\
      That's enough for me, that's enough for me.

And the main rule, as mentioned above is to indent all lines to make them stay inside the footnote.


$ hugo version
hugo v0.98.0+extended darwin/amd64 BuildDate=unknown

sergeyklay avatar May 10 '22 21:05 sergeyklay