# \[SOLVED\] Anchor image for headers

**URL:** https://discourse.gohugo.io/t/solved-anchor-image-for-headers/10314
**Category:** support
**Created:** [February 2, 2018, 12:12am UTC](https://discourse.gohugo.io/t/solved-anchor-image-for-headers/10314 "2018-02-02T00:12:59Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![dwa](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dwa/32/4526_2.png) [@dwa](https://discourse.gohugo.io/u/dwa)
#### Post date: [February 2, 2018, 12:12am UTC](https://discourse.gohugo.io/t/solved-anchor-image-for-headers/10314/1 "2018-02-02T00:12:59Z")

</div>

Hello all … For a single page, what I want to do is add anchor images to headers that link to the auto-generated ID tag like - for example - in the Hugo docs [https://gohugo.io/content-management/cross-references/#hugo-heading-anchors](https://gohugo.io/content-management/cross-references/#hugo-heading-anchors) .

I have read the [Adding anchor next to headers](https://discourse.gohugo.io/t/adding-anchor-next-to-headers/1726) thread, but I am at a loss about the most Markdown/Hugo-friendly way to proceed. Any help would be appreciated!

---

<div class="post-metadata">

### Author: ![dwa](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dwa/32/4526_2.png) [@dwa](https://discourse.gohugo.io/u/dwa)
#### Post date: [February 4, 2018, 12:27am UTC](https://discourse.gohugo.io/t/solved-anchor-image-for-headers/10314/2 "2018-02-04T00:27:03Z")

</div>

This [post on Stack Overflow](https://stackoverflow.com/a/43164165) was helpful!

Hugo already auto-generates an ID tag on each heading. I create a Hugo shortcode - `layouts/shortcodes/note-heading.html` - that generates the header link decorated with the calendar icon from [Feather Icons](https://feather.netlify.com/).

Then in my markdown document I use `{{< note-heading “A note of interest ” >}}` for headers.

---

<div class="post-metadata">

### Author: ![RickCogley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rickcogley/32/10269_2.png) [@RickCogley](https://discourse.gohugo.io/u/RickCogley)
#### Post date: [February 4, 2018, 12:59am UTC](https://discourse.gohugo.io/t/solved-anchor-image-for-headers/10314/3 "2018-02-04T00:59:35Z")

</div>

Would you mind linking your repo and the resulting site? I think it would be useful for understanding, should anyone want to try this technique.

---

<div class="post-metadata">

### Author: ![dwa](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dwa/32/4526_2.png) [@dwa](https://discourse.gohugo.io/u/dwa)
#### Post date: [February 4, 2018, 2:37am UTC](https://discourse.gohugo.io/t/solved-anchor-image-for-headers/10314/4 "2018-02-04T02:37:41Z")

</div>

Sure! Here is the shortcode …

> <https://github.com/vonbrownie/circuidipity/blob/master/layouts/shortcodes/note-heading.html>

… and here is the page where I use it - [https://www.circuidipity.com/notes/](https://www.circuidipity.com/notes/).

---

<div class="post-metadata">

### Author: ![RickCogley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rickcogley/32/10269_2.png) [@RickCogley](https://discourse.gohugo.io/u/RickCogley)
#### Post date: [February 4, 2018, 4:59am UTC](https://discourse.gohugo.io/t/solved-anchor-image-for-headers/10314/5 "2018-02-04T04:59:34Z")

</div>

Thanks!
