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

github.com/qqhann/hugo-primer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQiushi Pan <17402261+qqhann@users.noreply.github.com>2020-06-15 12:06:11 +0300
committerGitHub <noreply@github.com>2020-06-15 12:06:11 +0300
commit4ae78be3508ff5064d9e64069568635bdf68cc36 (patch)
tree5f6d4dde0a26a42b01c1cab850d3ca96b0d470e4
parent35053484e37ce935168d2f6ad24fa75d0398d6a1 (diff)
parent6d09d970359388bf45f3749719d9e91fa5d0b3cd (diff)
Merge pull request #45 from ContainerSolutions/gc/document-page-level-params
Update documentation for page-level params
-rw-r--r--README.md36
-rw-r--r--layouts/_default/single.html2
2 files changed, 35 insertions, 3 deletions
diff --git a/README.md b/README.md
index db1f705..bc90923 100644
--- a/README.md
+++ b/README.md
@@ -121,19 +121,51 @@ keywords:
---
```
-Example usage:
+#### page-level params
+
+hugo-primer also comes with some custom page level parameters
+
+- __showDate__ (default: __true__)
+shows the date on a post
+
+- __comments__ (default: __true__)
+setting to false will hide disqus comments
+
+- __toc__ (default: __true__)
+display the table of contents
+
+- __categories__ (default: __an empty list__)
+a list of categories to display in the sidebar
+
+- __tags__ (default: __an empty list__)
+a list of tags to display in the sidebar
+
+- __math__ (default: __false__)
+If math.js is disabled for the site you can use this setting to enable it for a single page
+
+- __keywords__ (default: __an empty list__)
+This adds a metatag to the page for listing keywords. This can be useful for SEO.
+
+
+Example usage where the defaults are overridden:
```md
---
+showdate: false
+comments: false
+toc: false
categories:
- Diary
tags:
- Shopping
- Health
+math: true
+keywords:
+- Cheese
+- Milk
---
```
-Set keywords for seo.
#### ruby annotation
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index b735167..6fb482d 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -43,7 +43,7 @@
{{ define "side" }}
- {{ if and (gt .WordCount 0 ) (ne .Params.toc "false") }}
+ {{ if and (gt .WordCount 0 ) (default true .Params.toc) }}
<div id="toc" class="Box Box--blue mb-3">
<b>{{ .Title }}</b>
{{- $toc := .TableOfContents -}}