I have generated a site with gohugo and ananke. If I include a heading, then hugo automatically creates an internal anchor for it: e.g.
<h1 id="foobar">foobar</h1>
But I would like a link icon to be displayed next to the heading, so that someone can click on this to extract the URL which links directly to this heading - such as the blue link icon here
That’s from Hugo’s own documentation site. But is that a standard Hugo feature that they’ve turned on? Or is it something magic in the custom theme from that site - and if so, how would I make my ananke site do the same thing?
An example of an internal link from my actual site is here
I don’t know JS, so I just add the links physically in the template. Using regex to parse and doctor HTML is not advisable, but it works great in this case:
In this example CSS looks whether it’s a PDF file and writes ‘PDF-File’ behind the link. Same applies to SVG or Graphics. Also you can think about Font Awesome. And you can ask @budparr who’s the developer of Ananke.
It is not, because the issue is adding a link with the right href, not displaying something that holds it. However what @kaushalmodi suggested is really clever.
I found in the main hugo repository a partial called docs/themes/gohugoioTheme/layouts/partials/icon-link.html - but I couldn’t find it referenced from anywhere significant: