HUGO

Footnote link not working

hi everyone,

a problem with footnotes has been bugging me since days. i simply cant figure out whats causing this.

I’m using my own fork of ezhil theme.

here’s a demo: https://themes.gohugo.io//theme/ezhil/post/markdown-syntax/

the foot notes link to https://themes.gohugo.io//theme/ezhil/#fnref:1
clicking this will go to homepage.

the correct link would be https://themes.gohugo.io//theme/ezhil/post/markdown-syntax/#fnref:1

how do i fix this bug? i search through theme for reference that might be related to this but simply couldn’t find anything about this.

Does it not work on your site or just the example site?

My guess is the problem is to do with how references are built, and many users gets confused about the right parameter values when a site is running in a subdirectory. This means the problem’s not really with the theme but with the config of sites using the theme.

it does not work on my site as well.

ezhil theme as of now does not work with hugo >= 0.55 so i rewrote some parts and made my own fork.

https://gitlab.com/synk.0x1/kavi-hugo-theme
you can install the theme and check, same thing.

someone else complaining the same thing, https://github.com/vividvilla/ezhil/issues/54
where he says it’ not working on his site either.

The problem is to do with the feather icons javascript library (I think).

The problem is a bit tricky, since the HTML looks fine. So I guessed there was some javascript somewhere changing the behaviour of the code, so I ripped out all the JS, and when I deleted this library it started working.

I don’t know anything about that library or what it’s meant to do (as you can see, my debugging process was pretty rough and ready), but I think that’s where the problem lays (so it’s not really a hugo thing).

adding this to <head> solved it for me.

<base href="{{ .Permalink }}">

2 Likes