Skip to content

Commit

Permalink
Add toggle to disable content tip per post
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Taylor committed Dec 22, 2022
1 parent 7f6f395 commit e0f3312
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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://`.

Expand All @@ -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`.

Expand Down
6 changes: 4 additions & 2 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<section id="single">
<h1 class="title">{{ .Title }}</h1>

<div class="tip">
{{ if ne .Params.showTip false }}
<div class="tip">
<time datetime="{{ .PublishDate }}">{{ i18n "publishDateFull" . }}</time>
<span class="split">
·
Expand All @@ -17,7 +18,8 @@ <h1 class="title">{{ .Title }}</h1>
<span>
{{ i18n "minuteRead" . }}
</span>
</div>
</div>
{{ end }}


{{ if or .Site.Params.showToc .Params.showToc }}
Expand Down

0 comments on commit e0f3312

Please sign in to comment.