diff options
author | amzrk2 | 2020-04-21 10:44:00 +0800 |
---|---|---|
committer | amzrk2 | 2020-04-21 10:44:00 +0800 |
commit | 94193538e3f10063bb31590108ea497d1a28084b (patch) | |
tree | cd9f25215e8cfe26a81a44c4a7eb4fa411c33280 | |
parent | d7fb3a9065eab673024c1ef5d0e6fd18b8a5d933 (diff) | |
download | hugo-theme-fuji-94193538e3f10063bb31590108ea497d1a28084b.tar.gz hugo-theme-fuji-94193538e3f10063bb31590108ea497d1a28084b.tar.bz2 hugo-theme-fuji-94193538e3f10063bb31590108ea497d1a28084b.zip |
Add TOC in post pages
-rw-r--r-- | assets/sass/_sidebar.scss | 1 | ||||
-rw-r--r-- | i18n/en.toml | 3 | ||||
-rw-r--r-- | i18n/ja.toml | 3 | ||||
-rw-r--r-- | i18n/zh-hans.toml | 3 | ||||
-rw-r--r-- | i18n/zh-hant.toml | 3 | ||||
-rw-r--r-- | layouts/partials/sidebar.html | 6 |
6 files changed, 19 insertions, 0 deletions
diff --git a/assets/sass/_sidebar.scss b/assets/sass/_sidebar.scss index 640494d..9010af5 100644 --- a/assets/sass/_sidebar.scss +++ b/assets/sass/_sidebar.scss @@ -17,6 +17,7 @@ @include link-secondary(); + #widget-toc, #widget-pages, #widget-tags, #widget-links { diff --git a/i18n/en.toml b/i18n/en.toml index bf453c8..02853ac 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -1,3 +1,6 @@ +[sidebarToc] + other = "TOC" + [sidebarPages] other = "Pages" diff --git a/i18n/ja.toml b/i18n/ja.toml index bb56474..eb283e6 100644 --- a/i18n/ja.toml +++ b/i18n/ja.toml @@ -1,3 +1,6 @@ +[sidebarToc] + other = "目次" + [sidebarPages] other = "ページ" diff --git a/i18n/zh-hans.toml b/i18n/zh-hans.toml index b38a405..56783e4 100644 --- a/i18n/zh-hans.toml +++ b/i18n/zh-hans.toml @@ -1,3 +1,6 @@ +[sidebarToc] + other = "目录" + [sidebarPages] other = "页面" diff --git a/i18n/zh-hant.toml b/i18n/zh-hant.toml index a1a9681..1f2ba0a 100644 --- a/i18n/zh-hant.toml +++ b/i18n/zh-hant.toml @@ -1,3 +1,6 @@ +[sidebarToc] + other = "目錄" + [sidebarPages] other = "頁面" diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 8b84596..0c3770d 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -1,3 +1,9 @@ +{{ if in .Site.Params.mainSections .Type }} +<div id="widget-toc"> + <h5>{{ i18n "sidebarToc" }}</h5> + {{.TableOfContents}} +</div> +{{ end }} <div id="widget-pages"> <h5>{{ i18n "sidebarPages" }}</h5> <ul> |