hugo/docs/content/en/methods/page/Plain.md
Bjørn Erik Pedersen 5fd1e74903
Merge commit '9b0050e9aabe4be65c78ccf292a348f309d50ccd' as 'docs'
```
git subtree add --prefix=docs/ https://github.com/gohugoio/hugoDocs.git master --squash
```

Closes #11925
2024-01-27 10:48:57 +01:00

960 B

title description categories keywords action
Plain Returns the rendered content of the given page, removing all HTML tags.
related returnType signatures
methods/page/Content
methods/page/RawContent
methods/page/PlainWords
methods/page/RenderShortcodes
string
PAGE.Plain

The Plain method on a Page object renders markdown and shortcodes to HTML, then strips the HTML tags. It does not strip HTML entities. The plain content does not include front matter.

To prevent Go's html/template package from escaping HTML entities, pass the result through the htmlUnescape function.

{{ .Plain | htmlUnescape }}