summaryrefslogtreecommitdiffstats
path: root/docs/content/en/functions/countwords.md
blob: 40a7b39e580e90ab4e30caeace0b9bc706a0e347 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
---
title: countwords
description: Counts the number of words in a string.
godocref:
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-02-01
categories: [functions]
menu:
  docs:
    parent: "functions"
keywords: [counting, word count]
signature: ["countwords INPUT"]
workson: []
hugoversion:
relatedfuncs: [countrunes]
deprecated: false
---

The template function works similar to the [.WordCount page variable][pagevars].

```
{{ "Hugo is a static site generator." | countwords }}
<!-- outputs a content length of 6 words.  -->
```


[pagevars]: /variables/page/