HUGO
Menu
GitHub 89546 stars Mastodon

WordCount

Returns the number of words in the content of the given page.

Syntax

PAGE.WordCount

Returns

int
{{ .WordCount }} → 103

To round up to the nearest multiple of 100, use the FuzzyWordCount method.

For content in CJK languages, set hasCJKLanguage to true in your project configuration. When enabled, Hugo applies CJK word counting rules to pages containing CJK characters. To override this behavior on a given page, set the isCJKLanguage field in its front matter.