2021-08-25 11:33:29 +00:00
|
|
|
+++
|
2022-06-05 17:31:59 +00:00
|
|
|
description = "Get value of site params"
|
2021-08-25 11:33:29 +00:00
|
|
|
title = "Site param"
|
|
|
|
+++
|
2017-09-04 20:24:36 +00:00
|
|
|
|
2022-06-05 17:31:59 +00:00
|
|
|
The `siteparam` shortcode prints values of site params.
|
2021-10-24 09:34:29 +00:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2022-06-22 22:03:24 +00:00
|
|
|
While the examples are using shortcodes with named parameter you are free to use positional aswell or call this shortcode from your own partials.
|
2022-06-05 17:31:59 +00:00
|
|
|
|
|
|
|
{{< tabs groupId="shortcode-parameter">}}
|
2022-06-22 22:03:24 +00:00
|
|
|
{{% tab name="shortcode" %}}
|
2022-06-05 17:31:59 +00:00
|
|
|
|
|
|
|
|
2021-10-24 09:34:29 +00:00
|
|
|
````go
|
2022-06-05 17:31:59 +00:00
|
|
|
{{%/* siteparam name="editURL" */%}}
|
2021-10-24 09:34:29 +00:00
|
|
|
````
|
|
|
|
|
2022-06-05 17:31:59 +00:00
|
|
|
{{% /tab %}}
|
2022-06-22 22:03:24 +00:00
|
|
|
{{% tab name="shortcode (positional)" %}}
|
2021-10-24 09:34:29 +00:00
|
|
|
|
2022-06-05 17:31:59 +00:00
|
|
|
````go
|
|
|
|
{{%/* siteparam "editURL" */%}}
|
|
|
|
````
|
2017-09-04 20:24:36 +00:00
|
|
|
|
2022-06-22 22:03:24 +00:00
|
|
|
{{% /tab %}}
|
|
|
|
{{% tab name="partial" %}}
|
|
|
|
|
|
|
|
````go
|
|
|
|
{{ partial "shortcodes/siteparam.html" (dict
|
|
|
|
"context" .
|
|
|
|
"name" "editURL"
|
|
|
|
)}}
|
|
|
|
````
|
|
|
|
|
2022-06-05 17:31:59 +00:00
|
|
|
{{% /tab %}}
|
|
|
|
{{< /tabs >}}
|
2017-09-04 20:24:36 +00:00
|
|
|
|
2022-06-05 17:31:59 +00:00
|
|
|
### Parameter
|
|
|
|
|
|
|
|
| Name | Position | Default | Notes |
|
|
|
|
|:---------------------|:---------|:-----------------|:------------|
|
|
|
|
| **name** | 1 | _<empty>_ | The name of the site param to be displayed. |
|
2017-09-04 20:24:36 +00:00
|
|
|
|
2022-06-05 17:31:59 +00:00
|
|
|
## Examples
|
|
|
|
|
|
|
|
### `editURL` from `config.toml`
|
2017-09-04 20:24:36 +00:00
|
|
|
|
2021-08-23 21:32:34 +00:00
|
|
|
```go
|
2022-06-05 17:31:59 +00:00
|
|
|
`editURL` value: {{%/* siteparam name="editURL" */%}}
|
2017-09-04 20:24:36 +00:00
|
|
|
```
|
|
|
|
|
2022-06-05 17:31:59 +00:00
|
|
|
`editURL` value: {{% siteparam name="editURL" %}}
|