From e0f3312ed02086eefef37b323e1b39eff7ab2c39 Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Thu, 22 Dec 2022 10:24:41 +0000 Subject: [PATCH] Add toggle to disable content tip per post --- README.md | 18 +++++++++++++++--- layouts/_default/single.html | 6 ++++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f21d1db4..2a41cc24 100644 --- a/README.md +++ b/README.md @@ -175,7 +175,19 @@ enableComments: false --- ``` -### 3.3 Custom CSS and JS +### 3.3 Disable word count and read time on a single post + +You can disable the word count and read time tip on pages that don't need it (eg about page) by setting `showTip` to `false`. + +For example: +```yaml +--- +title: post title +showTip: false +--- +``` + +### 3.4 Custom CSS and JS You can put your custom css and js files to `static` directory, or use remote css and js files which start with `http://` or `https://`. @@ -190,14 +202,14 @@ customJS: - https://example.com/custom.js # remote js ``` -### 3.4 Math Typesetting +### 3.5 Math Typesetting Mathematical notation is enabled by [KaTeX](https://katex.org/). - To enable KaTex globally set the parameter `math` to `true` in project’s configuration - To enable KaTex on a per page basis include the parameter `math` to `true` in content files -### 3.5 Hidden Post Summary in Home Page +### 3.6 Hidden Post Summary in Home Page To hidden post summary in home page, you could set `hiddenPostSummaryInHomePage` to `true`, default is `false`. diff --git a/layouts/_default/single.html b/layouts/_default/single.html index c4159a8c..159221f3 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -3,7 +3,8 @@

{{ .Title }}

-
+ {{ if ne .Params.showTip false }} +
· @@ -17,7 +18,8 @@

{{ .Title }}

{{ i18n "minuteRead" . }} -
+
+ {{ end }} {{ if or .Site.Params.showToc .Params.showToc }}