Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/htr3n/hyde-hyde.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuy Tran <hoang.huy.tran@gmail.com>2019-04-17 15:22:56 +0300
committerGitHub <noreply@github.com>2019-04-17 15:22:56 +0300
commitcbc21e8492ef9c20880ca8dbb5cd90caff18613d (patch)
tree08b6d94dc92dfacf963f320fb6babb66a1a513ab
parent5e5549399b78f50d981fb62206ad1e2fb0fda0af (diff)
parentf37e0a4ab3b671f57c70f034c318bf5a05a5f478 (diff)
Merge pull request #68 from tkstorm/master
add include_toc options
-rw-r--r--README.md2
-rw-r--r--layouts/partials/page-single/content.html21
-rw-r--r--layouts/partials/page-single/footer.html3
3 files changed, 16 insertions, 10 deletions
diff --git a/README.md b/README.md
index 49a653f..b999e0a 100644
--- a/README.md
+++ b/README.md
@@ -82,6 +82,8 @@ __`Hyde-hyde`__ essentially inherits most of Hyde's [options](https://github.com
github = "htr3n"
...
```
+
+* `include_toc = false`: Setting to `false` in FrontMatter will disable too short TOC data as your want.
* Per PR [#56](https://github.com/htr3n/hyde-hyde/commit/5ed13e17400bbc09a342b60fd50cd9fe3e6f1525), Gravatar pics can be used exclusively to `.Site.Params.authorimage` via the parameter `.Site.Params.social.gravatar`
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}}
<article>
<header>
<h1>{{ .Title }}</h1>
@@ -10,15 +11,17 @@
</header>
{{ $tableOfContents := .TableOfContents }}
{{ with .Site.Params.toc }}
- <div class="toc-wrapper">
- <input type="checkbox" id="tocToggle">
- <label for="tocToggle">Table of Content</label>
- {{ if eq . "hugo" }}
- {{ $tableOfContents }}
- {{ else if eq . "tocbot"}}
- <div class="toc" id="TableOfContents"></div>
- {{ end }}
- </div>
+ {{ if ne $include_toc false }}
+ <div class="toc-wrapper">
+ <input type="checkbox" id="tocToggle">
+ <label for="tocToggle">Table of Content</label>
+ {{ if eq . "hugo" }}
+ {{ $tableOfContents }}
+ {{ else if eq . "tocbot"}}
+ <div class="toc" id="TableOfContents"></div>
+ {{ end }}
+ </div>
+ {{ end }}
{{ end }}
<div class="post">
{{ .Content }}
diff --git a/layouts/partials/page-single/footer.html b/layouts/partials/page-single/footer.html
index 3e47ebe..7f23337 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 }}
<!-- Google Analytics -->
{{ template "_internal/google_analytics_async.html" . }}
@@ -5,7 +6,7 @@
{{ 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) }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.4.2/tocbot.js"></script>
<script type="text/javascript">
if (tocbot) {