Create a table of contents (toc) in a post with blogdown package

心已入冬 提交于 2020-02-25 05:47:45

问题


I know the short answer, add the following in the metadata toc: TRUE

But when I create a post with the blogdown package that have a table of content, I have problems with the url (redirection) behind the table options.

The links for the table of content are of the following form:

http://home-website/#tree-terminology

Instead to be:

http://home-website/post_name/#tree-terminology

How can reference the name of the post correctly in the url to generate the proper url in the table of content? In which part can find the configuration behind the toc behavior?


回答1:


As per Yihui's Github (https://github.com/yihui/hugo-xmin/pull/7), you might need to put

output:
  blogdown::html_page:
    toc: true

in your YAML. It's working properly on my website.



来源:https://stackoverflow.com/questions/46119371/create-a-table-of-contents-toc-in-a-post-with-blogdown-package

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!