From 5427aefb1fe389ac3acea9e87e1dbe82ddc3c5af Mon Sep 17 00:00:00 2001 From: Terry Rod Date: Tue, 2 Apr 2019 14:22:00 +0800 Subject: [PATCH 1/2] add include_toc options in FrontMatter --- layouts/partials/page-single/content.html | 21 ++++++++++++--------- layouts/partials/page-single/footer.html | 5 +++-- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/layouts/partials/page-single/content.html b/layouts/partials/page-single/content.html index 2c1924b..f923216 100644 --- a/layouts/partials/page-single/content.html +++ b/layouts/partials/page-single/content.html @@ -1,3 +1,4 @@ +{{ $include_toc := .Params.include_toc}}

{{ .Title }}

@@ -10,15 +11,17 @@
{{ $tableOfContents := .TableOfContents }} {{ with .Site.Params.toc }} -
- - - {{ if eq . "hugo" }} - {{ $tableOfContents }} - {{ else if eq . "tocbot"}} -
- {{ end }} -
+ {{ if ne $include_toc false }} +
+ + + {{ if eq . "hugo" }} + {{ $tableOfContents }} + {{ else if eq . "tocbot"}} +
+ {{ end }} +
+ {{ end }} {{ end }}
{{ .Content }} diff --git a/layouts/partials/page-single/footer.html b/layouts/partials/page-single/footer.html index 3e47ebe..90d7eed 100644 --- a/layouts/partials/page-single/footer.html +++ b/layouts/partials/page-single/footer.html @@ -1,3 +1,4 @@ +{{ $include_toc := .Params.include_toc}} {{ if .Site.GoogleAnalytics }} {{ template "_internal/google_analytics_async.html" . }} @@ -5,8 +6,8 @@ {{ partial "footer/font-awesome-js.html" . }} {{ partial "highlight-js.html" . }} {{ with .Site.Params.toc }} -{{ if eq . "tocbot" }} - +{{ if and (eq . "tocbot") (ne $include_toc false) }} + +