hugoDocs/content/functions/countwords.md
2017-02-26 22:23:06 -06:00

715 B

title linktitle description godocref date publishdate lastmod categories tags signature workson hugoversion relatedfuncs deprecated aliases
countwords countwords Counts the number of words in a string that has been passed to it. 2017-02-01 2017-02-01 2017-02-01
functions
counting
word count
countrunes
false
/functions/countrunes/
/functions/countwords/

countwords tries to convert the passed content to a string and counts each word in it. The template function works similar to the .WordCount page variable.

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