hugo-xmin/exampleSite/content/post/2018-01-11-test-toc.md

60 lines
1.8 KiB
Markdown
Raw Normal View History

---
title: another toc solution for blogdown fixing the pure Chinese issue
author: Heaven Zone
date: '2018-01-11'
2018-01-12 19:55:58 +02:00
slug: another-toc-solution-for-blogdown-fixing-the-pure-Chinese-issue
categories:
- R
tags:
- R
- blogdown
simpletoc: true
---
2018-01-12 19:55:58 +02:00
## origination
2018-01-12 19:55:58 +02:00
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.
2018-01-12 19:55:58 +02:00
As a amateur and beginneR, thanks for Yihui's GREAT present BLOGDOWN.
2018-01-12 19:55:58 +02:00
@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.
2018-01-12 19:55:58 +02:00
## feture
2018-01-12 19:55:58 +02:00
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
2018-01-12 19:55:58 +02:00
## usage
2018-01-12 19:55:58 +02:00
just add `simpletoc: true` into the block `---`.
2018-01-12 19:55:58 +02:00
### like this:
2018-01-12 19:55:58 +02:00
```
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
```
2018-01-12 19:55:58 +02:00
### what i did for this pull requrest?
2018-01-12 19:55:58 +02:00
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
2018-01-12 19:55:58 +02:00
#### H4 Test Section
2018-01-12 19:55:58 +02:00
Test
2018-01-12 19:55:58 +02:00
## H2 Test Section