hugo-theme-mini
hugo-theme-mini copied to clipboard
Setting up Table of Content for posts
Could you please tell me how can I set a TOC for posts? I write my stuff in RMarkdown (Rstudio) and push pandoc compiled htmls to github so that netlify can take care of the rest.
Is the TOC something I should set up in config.toml? I can't figure out how to make it work properly.
Generally only need to set enableToc = true
in config.toml
. And I use your config.toml
to generate my .md
files in exampleSite, it works fine. Could you upload to github or mail to me ([email protected]) all your Rstudio project files ? Let me have a look.
Hmm... I guess this has to do with me working with .Rmd
files for my posts (and not .md
).
enableToc = true
in config.toml
was set fromday 1 and it never worked
Ive uploaded all the source files
Aha, I found your .Rmd
files in your https://github.com/b1azk0/blog. I'll take a look now.
One way of going around this issue, is by adding:
output:
blogdown::html_page:
toc: true
toc_depth: 2
to a each post's yaml header.
It's not a solution as the TOC is ugly, but it's there (I updated my posts if you want to have a look)
Still the one that you have in your posts is much nicer
@b1azk0 , if you're using blogdown, or RStudio in general, use the .Rmarkdown file extension for your posts (not .Rmd) and it should inherit the css for the normal .md toc