JasonYao / JasonYao.github.io

My personal site at jasonyao.com using Hugo
https://www.jasonyao.com
GNU General Public License v3.0
1 stars 0 forks source link

Add anchor links next to content title #31

Closed JasonYao closed 3 years ago

JasonYao commented 3 years ago

NOTE: there's a stab at it over in this branch, but it dropped lighthouse score by about 20 points due to making page load slower. Consider wiring into generated content somehow, or other alternative approaches

JasonYao commented 3 years ago

taking a step back, this is the second time that I wish hugo had the ability to "wire into" the markdown -> html renderer- the first time was when I wanted to output a nice "copy" button to code blocks, but had to add in js to do it dynamically, instead of it just being in the generated html.

Instead of just going ahead and getting this working with js, see if there's a way to actually change the generated output itself, so we can get rid of js modifying the DOM after things load, since that has a performance hit

JasonYao commented 3 years ago

googling around didn't find anything, though it should be noted that with defer it looks like we should be ok. Fixed with b194323dfd190e6ef8825be970bb92435c7c2824