I have added bigfoot.js
to my Middleman blog site. On post pages, everything works as expected. On the main, index page, however, footnotes aren’t handled by Bigfoot.
Ok. I’ve actually had a realization, which alters and specifies the problem. The issue is not bigfoot.js
nor jQuery
. Both are loading and in the proper order. Rather the problem is with the article.summary
HTML used on the index page. The HTML generated by redcarpet
(the Markdown engine I’m using) puts the footnotes text in an li
element at the bottom of the page. So, if there is a footnote sup
element within the article.summary
, it will be within the summary on the index page, but the corresponding footnote text will not. Without the footnote text, bigfoot.js
can’t render properly.
So, my new issue is how to keep both the footnote link and the footnote content in the article summary?
For clarity’s sake, here’s some example HTML of the footnotes generated by redcarpet
in Middleman:
<p>This is the content of my blog post. That’s some text with a footnote.<sup id="fnref1"><a href="#fn1" rel="footnote">1</a></sup></p>
...
<div class="footnotes">
<hr>
<ol>
<li id="fn1">
<p>And that’s the footnote. <a href="#fnref1" rev="footnote">↩</a></p>
</li>
</ol>
</div>
I need a custom article summary generator that will go and get div.footnotes
and add it to the article summary. Unfortunately, I am a bit of a Ruby noob, so I’m uncertain how exactly to achieve this.