summaryrefslogtreecommitdiffstats
path: root/docs/content
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-11-27 16:53:11 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-11-27 17:34:03 +0100
commitf37c5a25676db89c0e804ccaac69bb392758192b (patch)
tree951a3259bd6f24243de5ba83dcfec0e32b61c241 /docs/content
parentaded0f25fd23a78804b10e127aebe0e4b6fed2ac (diff)
tpl: Add "param" shortcode
Fixes #4010
Diffstat (limited to 'docs/content')
-rw-r--r--docs/content/en/content-management/shortcodes.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/content/en/content-management/shortcodes.md b/docs/content/en/content-management/shortcodes.md
index 35305764c..5bb404fb2 100644
--- a/docs/content/en/content-management/shortcodes.md
+++ b/docs/content/en/content-management/shortcodes.md
@@ -15,6 +15,7 @@ categories: [content management]
keywords: [markdown,content,shortcodes]
draft: false
aliases: [/extras/shortcodes/]
+testparam: "Hugo Rocks!"
toc: true
---
@@ -240,6 +241,24 @@ Using the preceding `instagram` with `hidecaption` example above, the following
{{< instagram BWNjjyYFxVx hidecaption >}}
+### `param`
+
+Gets a value from the current `Page's` params set in front matter, with a fall back to the site param value. If will log an `ERROR` if the param with the given key could not be found in either.
+
+```bash
+{{</* param testparam */>}}
+```
+
+Since `testparam` is a param defined in front matter of this page wi the value `Hugo Rocks!`, the above will print:
+
+{{< param testparam >}}
+
+To access deeply nested params, use "dot syntax", e.g:
+
+```bash
+{{</* param "my.nested.param" */>}}
+```
+
### `ref` and `relref`
These shortcodes will look up the pages by their relative path (e.g., `blog/post.md`) or their logical name (`post.md`) and return the permalink (`ref`) or relative permalink (`relref`) for the found page.