Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Footnotes are not permalinked #2613

Open
reujab opened this issue Aug 14, 2024 · 4 comments
Open

Footnotes are not permalinked #2613

reujab opened this issue Aug 14, 2024 · 4 comments

Comments

@reujab
Copy link
Contributor

reujab commented Aug 14, 2024

Bug Report

When a page summary that contains a footnote is embedded on another page, that footnote link becomes broken. This does not happen with heading references because they are permalinked; I believe footnotes should be too.

I've fixed this in reujab@e9a9bf8, but I'm not sure this is the ideal solution. Let me know if I should open a pull request.

Environment

Zola version: v0.19.1

Expected Behavior

Tell us what should have happened.

The footnote should link to /permalink/#fn-1 rather than simply #fn-1, similar to heading references.

Current Behavior

Tell us what happens instead of the expected behavior. If you are seeing an
error, please include the full error message and stack trace. You can get the
stacktrace of a panic by adding RUST_BACKTRACE=1 when running a zola command.

The footnote is not permalinked.

Step to reproduce

Please provide the steps to reproduce the issue.
If the issue is hard to reproduce, please provide a sample repository or sample
that triggers the bug.

This issue can be observed on the homepage of https://github.com/reujab/knightweb.dev.

P.S. I love Zola; its design is perfect.

@Keats
Copy link
Collaborator

Keats commented Aug 14, 2024

I believe this is the way the GitHub style footnotes are meant to be. Their spec is not updated but i've checked a few implementations and they do use local links.

I don't see a big issue with making them permalinks though? cc @totikom that implemented them, I could be missing something.

@clarfonthey
Copy link
Contributor

Yeah, adding permalinks seems a bit excessive to me; you can make ordinary links to anchors on a page [like this](#anchor) and it doesn't permalink them. It feels like this would be inconsistent with that.

@reujab
Copy link
Contributor Author

reujab commented Aug 15, 2024

I was trying to find a way to permalink footnotes only if they are embedded inside another page, but I couldn't find a decent way to do that. I'll keep looking.

Also when I create a link to a heading [like this](#anchor), the link does become permalinked. Perhaps I'm misunderstanding.

@clarfonthey
Copy link
Contributor

Oh, maybe I was misremembering the behaviour here. If linking #anchor on the same page becomes permalinked, then I agree that footnotes should be as well.

I had no idea that you could link footnotes across pages, either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants