diff options
author | He Yeshuang <yeshuanghe@gmail.com> | 2020-06-20 16:49:36 +0300 |
---|---|---|
committer | He Yeshuang <yeshuanghe@gmail.com> | 2020-06-20 16:49:36 +0300 |
commit | 7394031c54d66e6285b4dcc041651a9125a0ff50 (patch) | |
tree | a0b2acbe50930716a0b4e2f686c328bc68687499 /layouts/partials | |
parent | 3df24a82173e10f6b9b1a59f7e588a3e38fb3c97 (diff) |
add 'table of contents' feature
Diffstat (limited to 'layouts/partials')
-rw-r--r-- | layouts/partials/page-header.html | 1 | ||||
-rw-r--r-- | layouts/partials/toc.html | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/layouts/partials/page-header.html b/layouts/partials/page-header.html index e66b019..6aeb563 100644 --- a/layouts/partials/page-header.html +++ b/layouts/partials/page-header.html @@ -16,4 +16,5 @@ {{- .Date.Format "2006-1-2 15:04" -}} </time> </div> +{{ partial "toc.html" . }} <hr />
\ No newline at end of file diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html new file mode 100644 index 0000000..1c6b5e0 --- /dev/null +++ b/layouts/partials/toc.html @@ -0,0 +1,10 @@ +{{ if (.Params.toc) }} +<details class="toc" open> +<summary> + <hr /> +</summary> +<div class="inline toc-content"> + {{.TableOfContents}} +</div> +</details> +{{ end }}
\ No newline at end of file |