Debian Codegraph @

docs/content/en/methods/page/WordCount.md

raw
1 ---
2 title: WordCount
3 description: Returns the number of words in the content of the given page.
4 categories: []
5 keywords: []
6 params:
7 functions_and_methods:
8 returnType: int
9 signatures: [PAGE.WordCount]
10 ---
11
12 ```go-html-template
13 {{ .WordCount }} → 103
14 ```
15
16 To round up to the nearest multiple of 100, use the [`FuzzyWordCount`][] method.
17
18 > [!NOTE]
19 > For content in [CJK](g) 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.
20
21 [`FuzzyWordCount`]: /methods/page/fuzzywordcount/
22 [`hasCJKLanguage`]: /configuration/all/#hascjklanguage
23 [`isCJKLanguage`]: /content-management/front-matter/#iscjklanguage