Skip to content
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
Choose a base branch
from
Open

Conversation

yihui
Copy link
Owner

@yihui 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 force-pushed the feature/show-toc branch from 4e1ddbf to dbe6fca Compare June 30, 2017 02:38
@yihui yihui added the feature label Jun 30, 2017
@yihui yihui force-pushed the feature/show-toc branch 2 times, most recently from cecb021 to be471d6 Compare July 9, 2017 17:46
@yihui yihui force-pushed the feature/show-toc branch 2 times, most recently from 132bf32 to b47be96 Compare July 13, 2017 07:08
@yihui yihui force-pushed the feature/show-toc branch from b47be96 to de81e09 Compare August 14, 2017 20:28
@yihui yihui force-pushed the feature/show-toc branch from de81e09 to 85a341d Compare August 29, 2017 03:02
@yihui yihui force-pushed the feature/show-toc branch from 85a341d to 3e341a9 Compare October 8, 2017 14:24
@yihui yihui force-pushed the feature/show-toc branch from 429663d to 858eb50 Compare March 21, 2018 15:39
@yihui yihui force-pushed the feature/show-toc branch from 858eb50 to 1a94e25 Compare August 30, 2018 15:02
@yihui yihui force-pushed the feature/show-toc branch from 1a94e25 to c47f304 Compare October 1, 2018 14:33
@enersto
Copy link

enersto commented Feb 1, 2019

So there is still no toc_float for html_page?

@yihui yihui force-pushed the feature/show-toc branch from c47f304 to d940844 Compare March 20, 2019 02:59
@yihui yihui force-pushed the feature/show-toc branch from d940844 to 3b9ba36 Compare April 18, 2019 19:01
@yihui yihui force-pushed the feature/show-toc branch from 3b9ba36 to 0b814ed Compare March 17, 2020 03:07
@yihui yihui force-pushed the feature/show-toc branch from 0b814ed to f43a399 Compare July 24, 2020 19:48
@yihui yihui force-pushed the feature/show-toc branch 2 times, most recently from c5cd722 to 7c8d7c3 Compare October 11, 2020 20:57
@yihui yihui force-pushed the feature/show-toc branch from 7c8d7c3 to c77e803 Compare June 15, 2022 03:53
@yihui yihui force-pushed the feature/show-toc branch from b1927ae to 91762e7 Compare March 4, 2024 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants