New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to show the table of contents #7

Open
wants to merge 2 commits into
base: master
from

Conversation

1 participant
@yihui
Owner

yihui commented Jun 23, 2017

It depends on whether your post is R Markdown or plain Markdown. For R Markdown, it is easy -- just add this to YAML:

output:
  blogdown::html_page:
    toc: true

Example: https://deploy-preview-7--hugo-xmin.netlify.com/post/2017/06/22/rmd-toc/

For plain Markdown posts, the template single.html has to be modified. For example, we can use a YAML parameter toc to control whether to write out .TableOfContents. Example: https://deploy-preview-7--hugo-xmin.netlify.com/about/

The CSS style was defined in style.css (a lightgray border).

@yihui yihui added the feature label Jun 30, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment