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

Remove Return links only from the popup, but not from the list #6

Open tflo opened 5 years ago

tflo commented 5 years ago

[This is a proposal for an improvement, not an issue]

In your script you say:

// Remove redundant [return] links from footnote list (optional)

I partially agree with this:

Why?

It is nothing unusual that a reader arrives at the end of the article, and discovers one or two footnotes in the list that he had missed as he was reading through the article.

So, without Return links in the list, he has no clue where the footnote belongs to. He has to search for the footnote number in the whole article, to get the context.

With Return links he can just click the link, no need to search.

In order to remove the Return link from the popup panel but not from the footnote list, I moved the code block (lines 36–41) down to after line 70, that is, at the end of the if clause, just after

popupWrapper.style.display = "flex";

This way the removal is limited to the popup content. Not sure if this is the optimal solution, but so far it works.

Let me know what you think about this.

– Tom

vaetas commented 5 years ago

I would like to keep it that way because I prefer as it is. However, your point is valid. I think the best solution might be to add a simple option to enable/disable return links so everybody can choose.

Calling this plugin would then require 3 parameters and it would become slightly confusing which is which. I don't want to add new configuration items until there will be better way to configure them (JSON objects or something else, I am not quite sure). Unfortunately, I am busy right now so it will have to wait for now. I will add this to my roadmap.