Closed orhun closed 1 year ago
I was hoping to help fix this bug but I am not sure how to reproduce it.
I used test_site and added 2 headers to content/2018/index.md like so:
+++
title = "index page in a direction with the same name as a section"
+++
# some title ⚡
## some title ⚡
I then copy pasted the ToC templating html from the docs into templates/page.html and ran zola serve
and got no errors.
When I go to the page that I edited, everything is rendered correctly, and the links read as #some-title-zap
and #some-title-zap-1
Oh, it can be easily reproduced like this:
Contents of content/2018/index.md
:
+++
title = "index page in a direction with the same name as a section"
+++
Table of contents:
- [some title ⚡](#some-title-)
- [some title ⚡](#some-title--1)
# some title ⚡
## some title ⚡
Logs:
Error: Failed to build the site
Error: Found 2 broken internal anchor link(s)
1. The anchor in the link `@/2018/index.md#some-title-` in /home/orhun/gh/zola/test_site/content/2018/index.md does not exist.
2. The anchor in the link `@/2018/index.md#some-title--1` in /home/orhun/gh/zola/test_site/content/2018/index.md does not exist.
+++
title = "index page in a direction with the same name as a section"
+++
Table of contents:
- [some title ⚡](#some-title-zap)
- [some title ⚡](#some-title-zap-1)
# some title ⚡
## some title ⚡
The above works fine for me. I recommend reading the docs that I referenced earlier for a more idiomatic way to handle table of contents.
I think this can be closed?
It still doesn't work for me for zola 0.17.2
I just tried with your example again and it worked. I guess my ToC generator was broken. Closing...
Bug Report
I'm not sure if this is a theme-related or Zola-related problem. Let me know if I need to submit this to after-dark theme.
My problem is I have the following markdown:
I generate the following ToC entry:
But I can't build the site:
Environment
Zola version:
zola 0.17.2
Expected Behavior
Succesful site generation.
Current Behavior
Outlined above.
Step to reproduce
Outlined above.