mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 23:38:53 +00:00
Revert "Update shortcode.md"
This reverts commitf8188f1c8c. Revert "Update shortcode.md" This reverts commit083fc39c68.
This commit is contained in:
@@ -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.inline 4.3 3.14 8.23 12.4 */>}}Sum: {{ math.Sum .Params }}{{</* /sum.inline */>}}
|
||||
{{</* time.inline */>}}{{ now }}{{</* /time.inline */>}}
|
||||
```
|
||||
|
||||
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
|
||||
{{</* sum.inline 3.14159265359 6.324 *//>}}
|
||||
{{</* time.inline /*/>}}
|
||||
```
|
||||
|
||||
[`.Parent`]: /methods/shortcode/parent/
|
||||
|
||||
Reference in New Issue
Block a user