# Problem: TOC and link path

**URL:** <https://discourse.gohugo.io/t/problem-toc-and-link-path/32128>\
**Category:** support\
**Created:** [April 2, 2021, 1:10pm UTC](https://discourse.gohugo.io/t/problem-toc-and-link-path/32128 "2021-04-02T13:10:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![myFrank-wk](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/myfrank-wk/32/18912_2.png) [@myFrank-wk](https://discourse.gohugo.io/u/myFrank-wk)\
**Post date:** [April 2, 2021, 1:10pm UTC](https://discourse.gohugo.io/t/problem-toc-and-link-path/32128/1 "2021-04-02T13:10:38Z")

</div>

Hello,

I have the following problem: The Table of Content is created correctly in a blog article, but the link path looks like this:

localhost:1313/#example-header

By clicking on the TOC link, the article is left and the home page is called up. The creation of the TOC is generated by a shortcode. The shortcode just consists of the following code: {{.Page.TableOfContents}}

The project is multilingual. The entire link works fine, but the TOC link does not include the article name in the link. Can someone give me a hint - what am I doing wrong?

hugo v0.82.0 + extended darwin / amd64

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [April 2, 2021, 2:07pm UTC](https://discourse.gohugo.io/t/problem-toc-and-link-path/32128/2 "2021-04-02T14:07:47Z")

</div>

Do you have a heading render hook (layouts/\_default/\_markup/render-heading.html)?  
What does your site configuration look like?

It would be _really_ helpful if you could share a link to the public repository for your project.

---

<div class="post-metadata">

**Author:** ![myFrank-wk](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/myfrank-wk/32/18912_2.png) [@myFrank-wk](https://discourse.gohugo.io/u/myFrank-wk)\
**Post date:** [April 2, 2021, 2:37pm UTC](https://discourse.gohugo.io/t/problem-toc-and-link-path/32128/3 "2021-04-02T14:37:19Z")

</div>

Thank you for your reply.

> Do you have a heading render hook (layouts/\_default/\_markup/render-heading.html)?

Yes, I used the example [Configure markup | Hugo](https://gohugo.io/getting-started/configuration-markup/#heading-link-example).

> What does your site configuration look like?

```
baseURL = "https://tekki-tipps.de/"
languageCode = "de-DE"
title = "tekki-tipps.de"
theme = "tekki"
enableRobotsTXT = "true"
relativeURLs = "true"
DefaultContentLanguage = "de"

[languages]
  [languages.de]
    languageName = "Deutsch"
    weight = 1
    description = "in deutsch"
    [[languages.de.menu.main]]
      url = "/leer/"
      name = "Tags"
      weight = 1
    [[languages.de.menu.main]]
      url = "/datenschutz/"
      name = "Datenschutz"
      weight = 10
    [[languages.de.menu.main]]
      url = "/impressum/"
      name = "Impressum"
      weight = 20
  [languages.en]
    languageName = "English"
    weight = 2
    description = "in english"

    [[languages.en.menu.main]]
      url = "/leer/"
      name = "Tags"
      weight = 1
    [[languages.en.menu.main]]
      url = "/data-protection/"
      name = "Data Protection"
      weight = 10
    [[languages.en.menu.main]]
      url = "/imprint/"
      name = "Imprint"
      weight = 20

[params]
  homeTitle = "Hugo, Webdesign, CSS/SCSS, SEO, Tools"

[taxonomies]
  tag = "tags"

[markup]
  [markup.goldmark]
    [markup.goldmark.renderer]
      unsafe = true
  [markup.highlight]
    noClasses = false
  [markup.tableOfContents]
    endLevel = 3
    ordered = false
    startLevel = 2

[permalinks]
  blog = "/:slug/"

```

If I want help, I have to provide the basis for it. But I don’t want to make my entire source publicly available. I have no problem sending you my source personally. Would that be a possibility?

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [April 2, 2021, 2:48pm UTC](https://discourse.gohugo.io/t/problem-toc-and-link-path/32128/4 "2021-04-02T14:48:32Z")

</div>

The heading render hook example in the documentation does not produce anything special. It simply demonstrates how to customize a heading.

Please disable the heading render hook by renaming:

```auto
layouts/_default/_markup/render-heading.html

```

To:

```auto
layouts/_default/_markup/xxx-render-heading.html

```

Then test again. That will remove one variable from the equation.

> [@myFrank-wk](#):
>
> I have no problem sending you my source personally. Would that be a possibility?

Yes, please do.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [April 2, 2021, 4:06pm UTC](https://discourse.gohugo.io/t/problem-toc-and-link-path/32128/5 "2021-04-02T16:06:17Z")

</div>

Thank you for sharing your repository (privately). That made troubleshooting much easier.

The TOC items are generated correctly. For example:

```auto
<li><a href="#svg-icon-per-font-schnell-einbinden">SVG-Icon per Font schnell einbinden</a></li>

```

The problem is in `themes/tekki/layouts/partials/head.html`.

```auto
<base href="{{ .Site.BaseURL }}">

```

This is causing the browser to go to:

```nohighlight
http://localhost:1313/#svg-icon-per-font-schnell-einbinden

```

Remove that line from your template.

Other comments:

1. Do not quote boolean (true/false) values when writing TOML. For example, in your config.toml file do this:

2. Your heading render hook is incorrect.

---

<div class="post-metadata">

**Author:** ![myFrank-wk](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/myfrank-wk/32/18912_2.png) [@myFrank-wk](https://discourse.gohugo.io/u/myFrank-wk)\
**Post date:** [April 2, 2021, 4:11pm UTC](https://discourse.gohugo.io/t/problem-toc-and-link-path/32128/6 "2021-04-02T16:11:39Z")

</div>

Wow, thank you very much for your private commitment. That helps me alot.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [April 4, 2021, 4:12pm UTC](https://discourse.gohugo.io/t/problem-toc-and-link-path/32128/7 "2021-04-04T16:12:07Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
