mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-19 21:21:39 +02:00
Make each generated page’s footnotes unique.
If content pages are fully rendered in a list page, footnotes that use the same reference (`[^fn]`) will have duplicated anchors. This change builds on #526 to put the page filename (`Page.File.Name`) as part of the anchor for a footnote. This would fix discussion [116](http://discuss.gohugo.io/t/footnote-references-are-duplicated-on-list-pages/116).
This commit is contained in:
@@ -93,7 +93,7 @@ func ShortcodesHandle(stringToParse string, p *Page, t Template) string {
|
||||
var data = &ShortcodeWithPage{Params: params, Page: p}
|
||||
if endStart > 0 {
|
||||
s := stringToParse[leadEnd+3 : leadEnd+endStart]
|
||||
data.Inner = template.HTML(renderBytes([]byte(CleanP(ShortcodesHandle(s, p, t))), p.guessMarkupType()))
|
||||
data.Inner = template.HTML(renderBytes([]byte(CleanP(ShortcodesHandle(s, p, t))), p.guessMarkupType(), p.File.Name))
|
||||
remainder := CleanP(stringToParse[leadEnd+endEnd:])
|
||||
|
||||
return CleanP(stringToParse[:leadStart]) +
|
||||
|
Reference in New Issue
Block a user