Merge pull request #314 from icy-comet/patch-1
document `Toc`, `TocTitle` & `readingTime`
This commit is contained in:
commit
9d458d193f
30
README.md
30
README.md
@ -32,12 +32,18 @@
|
||||
|
||||
#### Built-in shortcodes
|
||||
|
||||
- **`image`** (prop required: **`src`**; props optional: **`alt`**, **`position`** (**left** is default | center | right), **`style`**)
|
||||
- eg: `{{< image src="/img/hello.png" alt="Hello Friend" position="center" style="border-radius: 8px;" >}}`
|
||||
- **`image`** (props required: **`src`**; props optional: **`alt`**, **`position`** (**left** is default | center | right), **`style`**)
|
||||
- e.g.
|
||||
```go
|
||||
{{< image src="/img/hello.png" alt="Hello Friend" position="center" style="border-radius: 8px;" >}}
|
||||
```
|
||||
- **`figure`** (same as `image`, plus few optional props: **`caption`**, **`captionPosition`** (left | **center** is default | right), **`captionStyle`**)
|
||||
- eg: `{{< figure src="/img/hello.png" alt="Hello Friend" position="center" style="border-radius: 8px;" caption="Hello Friend!" captionPosition="right" captionStyle="color: red;" >}}`
|
||||
- **`code`** (prop required: **`language`**; props optional: **`title`**, **`id`**, **`expand`** (default "△"), **`collapse`** (default "▽"), **`isCollapsed`**)
|
||||
- eg:
|
||||
- e.g.
|
||||
```go
|
||||
{{< figure src="/img/hello.png" alt="Hello Friend" position="center" style="border-radius: 8px;" caption="Hello Friend!" captionPosition="right" captionStyle="color: red;" >}}
|
||||
```
|
||||
- **`code`** (props required: **`language`**; props optional: **`title`**, **`id`**, **`expand`** (default "△"), **`collapse`** (default "▽"), **`isCollapsed`**)
|
||||
- e.g.
|
||||
```go
|
||||
{{< code language="css" title="Really cool snippet" id="1" expand="Show" collapse="Hide" isCollapsed="true" >}}
|
||||
pre {
|
||||
@ -148,8 +154,18 @@ paginate = 5
|
||||
# updatedDatePrefix = "Updated"
|
||||
|
||||
# set all headings to their default size (depending on browser settings)
|
||||
# it's set to `true` by default
|
||||
# oneHeadingSize = false
|
||||
# oneHeadingSize = true # default
|
||||
|
||||
# whether to show a page's estimated reading time
|
||||
# readingTime = false # default
|
||||
|
||||
# whether to show a table of contents
|
||||
# can be overridden in a page's front-matter
|
||||
# Toc = false # default
|
||||
|
||||
# set title for the table of contents
|
||||
# can be overridden in a page's front-matter
|
||||
# TocTitle = "Table of Contents" # default
|
||||
|
||||
|
||||
[params.twitter]
|
||||
|
@ -28,16 +28,10 @@
|
||||
{{ end }}
|
||||
{{ partial "cover.html" . }}
|
||||
|
||||
{{ if .Params.Toc }}
|
||||
{{ if (.Params.Toc | default .Site.Params.Toc) }}
|
||||
<div class="table-of-contents">
|
||||
<h2>
|
||||
{{ if .Params.TocTitle }}
|
||||
{{ .Params.TocTitle }}
|
||||
{{ else if $.Site.Params.TocTitle }}
|
||||
{{ $.Site.Params.TocTitle }}
|
||||
{{ else }}
|
||||
Table of Contents
|
||||
{{ end }}
|
||||
{{ (.Params.TocTitle | default .Site.Params.TocTitle) | default "Table of Contents" }}
|
||||
</h2>
|
||||
{{ .TableOfContents }}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user