mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-13 22:16:02 +00:00
1 parent
4c3fd4fa4d
commit
36736ca280
1 file changed
+19
@@ -15,6 +15,7 @@ categories: [content management]
|
|||||||
keywords: [markdown,content,shortcodes]
|
keywords: [markdown,content,shortcodes]
|
||||||
draft: false
|
draft: false
|
||||||
aliases: [/extras/shortcodes/]
|
aliases: [/extras/shortcodes/]
|
||||||
|
testparam: "Hugo Rocks!"
|
||||||
toc: true
|
toc: true
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -240,6 +241,24 @@ Using the preceding `instagram` with `hidecaption` example above, the following
|
|||||||
{{< instagram BWNjjyYFxVx hidecaption >}}
|
{{< 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`
|
### `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.
|
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.
|
||||||
|
|||||||
Reference in new issue
Block a user