Theme: How do I add a link to the header next to each header?

Like on GitHub, and on other sites, there’s a link button often left of the header:

While hovering over a header,link icon appears. The link icon links to the header (with ID).

How do I achive that in my theme?

There doesn’t seem to be anything disabling it from appearing. I couldn’t figure out the reason why for example Hermit does render the header link, yet Plains doesn’t.

You have to add the feature, either as render-heading as in the Hugo theme, or similar to how the Hermit theme does it in this line: