github.com/shohhei1126/hugo@v0.42.2-0.20180623210752-3d5928889ad7/docs/content/en/functions/countwords.md (about) 1 --- 2 title: countwords 3 description: Counts the number of words in a string. 4 godocref: 5 date: 2017-02-01 6 publishdate: 2017-02-01 7 lastmod: 2017-02-01 8 categories: [functions] 9 menu: 10 docs: 11 parent: "functions" 12 keywords: [counting, word count] 13 signature: ["countwords INPUT"] 14 workson: [] 15 hugoversion: 16 relatedfuncs: [countrunes] 17 deprecated: false 18 aliases: [/functions/countwords/] 19 --- 20 21 The template function works similar to the [.WordCount page variable][pagevars]. 22 23 ``` 24 {{ "Hugo is a static site generator." | countwords }} 25 <!-- outputs a content length of 6 words. --> 26 ``` 27 28 29 [pagevars]: /variables/page/