This should always run, including when navigating between Hugo pages or reloading and no Giscus comment system at the bottom of the page).
My code is here and the partial is added here. The goal is to always run line 58 (
onPageLoaded()) when opening any article, and you’ll see various methods I’ve tried at lines 84-104 such as
window.onload etc. Unfortunately, none of those worked consistently for me when navigating between Hugo pages.
It seems that navigating between pages in Hugo doesn’t cauase the