diff --git a/README.md b/README.md index c19ed12..a4f2168 100644 --- a/README.md +++ b/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 +``` + diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 676b198..8ec4839 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -16,7 +16,10 @@ {{ . }} {{- end -}} {{- if and (.Param "readingTime") (eq (.Param "readingTime") true) -}} - {{ .ReadingTime }} {{ $.Site.Params.minuteReadingTime | default "min read" }} ({{ .WordCount }} {{ $.Site.Params.words | default "words" }}) + {{ .ReadingTime }} {{ $.Site.Params.minuteReadingTime | default "min read" }} + {{- end -}} + {{- if and (.Param "showWordCount") (eq (.Param "readingTime") true) -}} + {{ .WordCount }} {{ $.Site.Params.words | default "words" }} {{- end -}}