2021-08-25 11:33:29 +00:00
|
|
|
+++
|
2021-09-11 13:46:14 +00:00
|
|
|
description = "Get value of site params variables in your page"
|
2021-08-25 11:33:29 +00:00
|
|
|
title = "Site param"
|
|
|
|
+++
|
2017-09-04 20:24:36 +00:00
|
|
|
|
2021-10-24 09:34:29 +00:00
|
|
|
The `siteparam` shortcode is used to help you print values of site params.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
````go
|
2021-10-24 11:03:38 +00:00
|
|
|
{{%/* siteparam <string> */%}}
|
2021-10-24 09:34:29 +00:00
|
|
|
````
|
|
|
|
|
|
|
|
The first required parameter is the name of the site param to be displayed.
|
|
|
|
|
|
|
|
## Examples
|
2017-09-04 20:24:36 +00:00
|
|
|
|
|
|
|
For instance, in this current site, the `editURL` variable is used in `config.toml`
|
|
|
|
|
|
|
|
```toml
|
|
|
|
[params]
|
2021-07-01 09:01:51 +00:00
|
|
|
editURL = "https://github.com/McShelby/hugo-theme-relearn/edit/main/exampleSite/content/"
|
2017-09-04 20:24:36 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Use the `siteparam` shortcode to display its value.
|
|
|
|
|
2021-08-23 21:32:34 +00:00
|
|
|
```go
|
2017-09-04 20:24:36 +00:00
|
|
|
`editURL` Value : {{%/* siteparam "editURL" */%}}
|
|
|
|
```
|
|
|
|
|
|
|
|
is displayed as
|
|
|
|
|
|
|
|
`editURL` Value : {{% siteparam "editURL" %}}
|