Hi everyone, I deploy my website 1 month ago with “Academic Theme” and updated recently. It works fine, without problem on GitHub hosting.
I tried to implement TOC (Table of Contents) like as described on Academic Documentation, link is here:
Content can be written using Markdown, LaTeX math, and Hugo Shortcodes. Additionally, HTML may be used for advanced formatting. This article gives an overview of the most common formatting options.
and it get only Heading1 and Heading2, by shortcode directly on markdown post,
{{% toc %}}
I’m reading other files in themes folder, but I cannot to solve it. Only I saw these lines in academic.js
// Fix Hugo’s inbuilt Table of Contents.
_ $(’#TableOfContents > ul > li > ul’).unwrap().unwrap();_
Thanks for your help.
Marcus
zwbetz
October 28, 2018, 12:57pm
2
Can you share your git repo? This is hard to troubleshoot without seeing your code.
zwbetz
October 28, 2018, 5:55pm
4
This is a link to your theme’s repo. I meant your site’s repo.
Is the informational warning at the top of this page relevant:
And yeah, that javascript you cited? It looks like it removes parents so, there’s some interaction between that and the native hugo TOC code I would imagine. It might be fastest to talk to the theme author?
Yes you are right. I saw only that forum for to discuss about it. Thank you.
zwbetz
October 29, 2018, 4:28pm
9
Yes. Which blog post in particular are you having the issue with?
Hi, the post with TOC is this one .
Author’s theme said same thing. Hugo system take the variable .TableOfContent but get only H1 and H2, explained as comment above. So If I want to modify it, I cannot…isn’t it?
zwbetz
October 29, 2018, 8:42pm
11
I see. Well, like @RickCogley mentioned, you will need to take a look at the JavaScript that is editing the Table of Contents output.