hugo-xmin/exampleSite/content/post/2018-01-11-test-toc.md
2018-01-13 01:55:58 +08:00

60 lines
1.8 KiB
Markdown

---
title: another toc solution for blogdown fixing the pure Chinese issue
author: Heaven Zone
date: '2018-01-11'
slug: another-toc-solution-for-blogdown-fixing-the-pure-Chinese-issue
categories:
- R
tags:
- R
- blogdown
simpletoc: true
---
## origination
after taking a little bit of effort to read these two articles in ENGLISH from yihui's blog: [1st](https://yihui.name/en/2017/12/blogdown-book/), [2nd](https://yihui.name/en/2017/09/pull-requests-as-a-teaching-tool/), I decided to make a pull request to give some feedbacks to Yihui.
As a amateur and beginneR, thanks for Yihui's GREAT present BLOGDOWN.
@yihui, I love reading your articles, especially the Chinese articles, like: [16 小时骑行——我的天津绝望之旅](https://yihui.name/cn/2005/08/ride-to-tianjin-in-16-hours/). Yihui's words are always sharp. I feel some sad that it has been a very very long time since you last updated your blog for Chinese articles as a literary youth.
## feture
1. Originally intended for fixing the issue that not generating the links for pure Chinese headlines
1. Toc with fixed position floating right
1. Automatically generate the sections numbers
## usage
just add `simpletoc: true` into the block `---`.
### like this:
```
title: another toc solution for blogdown fixing the pure Chinese issue
author: Heaven Zone
date: '2018-01-11'
slug: another-toc-solution-for-blogdown-fixing-the-pure-Chinese-issue
categories:
- R
tags:
- R
- blogdown
simpletoc: true
```
### what i did for this pull requrest?
1. add one partial file `simpletoc.html`
1. add one js file `simpletoc.js`
1. modified single.html appending three rows of codes
1. add one post for example using custom param `simpletoc: true` for generating the toc
#### H4 Test Section
Test
## H2 Test Section