# HTML anchor tags should be made from markdown headers

**URL:** <https://discourse.gohugo.io/t/html-anchor-tags-should-be-made-from-markdown-headers/202>\
**Category:** feature\
**Created:** [October 10, 2014, 5:51pm UTC](https://discourse.gohugo.io/t/html-anchor-tags-should-be-made-from-markdown-headers/202 "2014-10-10T17:51:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lloydde](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/lloydde/32/100_2.png) [@lloydde](https://discourse.gohugo.io/u/lloydde)\
**Post date:** [October 10, 2014, 5:51pm UTC](https://discourse.gohugo.io/t/html-anchor-tags-should-be-made-from-markdown-headers/202/1 "2014-10-10T17:51:29Z")

</div>

It would be good if HTML anchor tags were automatically created for markdown headers. This is a feature of github markdown.

REPO always  
STEPS

1. Go to [http://gohugo.io/overview/quickstart](http://gohugo.io/overview/quickstart)
2. Click “upgrade”

ACTUAL RESULT  
At the top of [http://gohugo.io/overview/installing](http://gohugo.io/overview/installing)

EXPECTED RESULT  
At the “upgrade” section of the page.

ADDITIONAL DETAILS  
"if the Header has multiple words, like “My Header”, you can use `[Link to my Header](#my-header)`. This works at least in GitHub flavor." from [stackoverflow.com/questions/6695439/how-do-you-create-link-to-a-named-anchor-in-multimarkdown](http://stackoverflow.com/questions/6695439/how-do-you-create-link-to-a-named-anchor-in-multimarkdown)

---

<div class="post-metadata">

**Author:** ![fedelibre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/fedelibre/32/50_2.png) [@fedelibre](https://discourse.gohugo.io/u/fedelibre)\
**Post date:** [October 10, 2014, 9:28pm UTC](https://discourse.gohugo.io/t/html-anchor-tags-should-be-made-from-markdown-headers/202/2 "2014-10-10T21:28:47Z")

</div>

I think that you should follow this issue:

> <https://github.com/russross/blackfriday/issues/102>
>
> It would be really nice is to have the anchor URLs be generated as a lowercase, hyphenated version of the title...

---

<div class="post-metadata">

**Author:** ![halostatue](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/halostatue/32/62_2.png) [@halostatue](https://discourse.gohugo.io/u/halostatue)\
**Post date:** [October 27, 2014, 9:07pm UTC](https://discourse.gohugo.io/t/html-anchor-tags-should-be-made-from-markdown-headers/202/3 "2014-10-27T21:07:51Z")

</div>

I have put a pair of PRs in on blackfriday that will make this work properly with a small change to hugo.

---

<div class="post-metadata">

**Author:** ![halostatue](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/halostatue/32/62_2.png) [@halostatue](https://discourse.gohugo.io/u/halostatue)\
**Post date:** [October 29, 2014, 5:18am UTC](https://discourse.gohugo.io/t/html-anchor-tags-should-be-made-from-markdown-headers/202/4 "2014-10-29T05:18:24Z")

</div>

The PR was accepted into blackfriday. I have implemented a naïve version for Hugo:

> <https://github.com/gohugoio/hugo/pull/591>

There are caveats to this; even though it’s a one-line change and a generally good idea, I’m not sure that I would want to merge it as is. Please read the PR for details.
