summaryrefslogtreecommitdiffstats
path: root/docs/content/en/_common/functions/go-html-template-package.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/content/en/_common/functions/go-html-template-package.md')
-rw-r--r--docs/content/en/_common/functions/go-html-template-package.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/content/en/_common/functions/go-html-template-package.md b/docs/content/en/_common/functions/go-html-template-package.md
new file mode 100644
index 000000000..57992ea66
--- /dev/null
+++ b/docs/content/en/_common/functions/go-html-template-package.md
@@ -0,0 +1,14 @@
+---
+_comment: Do not remove front matter.
+---
+
+Hugo uses Go's [text/template] and [html/template] packages.
+
+The text/template package implements data-driven templates for generating textual output, while the html/template package implements data-driven templates for generating HTML output safe against code injection.
+
+By default, Hugo uses the html/template package when rendering HTML files.
+
+To generate HTML output that is safe against code injection, the html/template package escapes strings in certain contexts.
+
+[text/template]: https://pkg.go.dev/text/template
+[html/template]: https://pkg.go.dev/html/template