vaetas / hugo-footnotes-popup

Pure JavaScript plugin to make your footnotes displayed in a panel. Works with footnotes generated from Markdown in Hugo.
https://www.vaetas.cz/posts/hugo-footnotes-popup/
MIT License
25 stars 3 forks source link

Include instructions for multi-line footnotes #7

Open trosel opened 4 years ago

trosel commented 4 years ago

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?

vaetas commented 4 years ago

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.

tflo commented 4 years ago

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

sergeyklay commented 2 years ago

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