layouts/_default/single.html, README.md: add showWordCount option
This commit is contained in:
parent
ae454bef38
commit
13ca81158d
2 changed files with 15 additions and 1 deletions
11
README.md
11
README.md
|
@ -7,3 +7,14 @@ the files in my Hugo site's root directory.
|
|||
This is the theme used on [my website](https://revsuine.xyz/). You can see the website source
|
||||
[here](https://git.revsuine.xyz/revsuine/revsuine.xyz).
|
||||
|
||||
## Configuration
|
||||
|
||||
The same as [upstream](https://github.com/panr/hugo-theme-terminal?tab=readme-ov-file#how-to-configure), with the
|
||||
following changes:
|
||||
|
||||
```ini
|
||||
[params]
|
||||
# whether to show a page's word count
|
||||
showWordCount = true
|
||||
```
|
||||
|
||||
|
|
|
@ -16,7 +16,10 @@
|
|||
<span class="post-author">{{ . }}</span>
|
||||
{{- end -}}
|
||||
{{- if and (.Param "readingTime") (eq (.Param "readingTime") true) -}}
|
||||
<span class="post-reading-time">{{ .ReadingTime }} {{ $.Site.Params.minuteReadingTime | default "min read" }} ({{ .WordCount }} {{ $.Site.Params.words | default "words" }})</span>
|
||||
<span class="post-reading-time">{{ .ReadingTime }} {{ $.Site.Params.minuteReadingTime | default "min read" }}</span>
|
||||
{{- end -}}
|
||||
{{- if and (.Param "showWordCount") (eq (.Param "readingTime") true) -}}
|
||||
<span class="post-word-count">{{ .WordCount }} {{ $.Site.Params.words | default "words" }}</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in a new issue