Open
Description
Bug Report
Environment
Zola version: 0.19.2
Expected Behavior
A page of the form
+++
title="Test"
date="2024-11-27"
+++
Paragraph 1[^1].
<!-- more -->
Paragraph 2[^2].
[^1]: Footnote 1
[^2]: Footnote 2
should be rendered something like
Paragraph 1 (1)
Paragraph 2 (2)
----
1: footnote 1
2: footnote 2
Current Behavior
It actually renders with unexpected label order, or with repeated labels, eg.
Paragraph 1 (1)
Paragraph 2 (1)
----
2: footnote 1
1: footnote 2
Example output with the hyde theme:
The HTML generated by hyde looks like this:
<div class="post">
<h1 class="post-title">Test</h1>
<span class="post-date">2024-11-27</span>
<p>Paragraph 1<sup class="footnote-reference"><a href="[#1](view-source:http://127.0.0.1:1111/test/#1)">1</a></sup>.</p>
<span id="continue-reading"></span>
<p>Paragraph 2<sup class="footnote-reference"><a href="[#2](view-source:http://127.0.0.1:1111/test/#2)">1</a></sup>.</p>
<div class="footnote-definition" id="1">
<sup class="footnote-definition-label">2</sup>
<p>Footnote 1</p>
</div>
<div class="footnote-definition" id="2">
<sup class="footnote-definition-label">1</sup>
<p>Footnote 2</p>
</div>
</div>
Note that the footnote IDs are correct, it is just the labels which are incorrect.
Step to reproduce
A bare minimum zola setup with the example markdown page above shows the issue, at least to me. I've checkedit with the hyde and lightspeed themes.
Removing the <!-- more -->
element, or shifting all the footnote links above or below the <!-- more -->
makes the problem go away. It only happens when there's at least one footnote reference above the fold, and one below it.