From f7ec2ee9c2d99504cf5eee37ffc1a2512be15b05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 2 Jan 2025 22:07:07 +0100 Subject: [PATCH] Revert "Update shortcode.md" This reverts commit f8188f1c8c0dfb56fb634d799d3c417c08a780ad. Revert "Update shortcode.md" This reverts commit 083fc39c6820957633df3424c7ccd20a28577514. --- content/en/templates/shortcode.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/en/templates/shortcode.md b/content/en/templates/shortcode.md index d1d8dee01..5587c7479 100644 --- a/content/en/templates/shortcode.md +++ b/content/en/templates/shortcode.md @@ -395,10 +395,10 @@ It is disabled by default for security reasons. The security model used by Hugo' And once enabled, you can do this in your content files: ```go-html-template -{{}}Sum: {{ math.Sum .Params }}{{}} + {{}}{{ now }}{{}} ``` -The above will print the sum of the numbers given. +The above will print the current date and time. Note that an inline shortcode's inner content is parsed and executed as a Go text template with the same context as a regular shortcode template. @@ -407,7 +407,7 @@ This means that the current page can be accessed via `.Page.Title` etc. This als The same inline shortcode can be reused later in the same content file, with different arguments if needed, using the self-closing syntax: ```go-html-template -{{}} +{{}} ``` [`.Parent`]: /methods/shortcode/parent/