Skip to content

Commit 5ceb024

Browse files
committed
Implement the site-param shortcode
We are about to use a site parameter in a content page. Regular Hugo functions cannot be used on content pages, though, only shortcodes, but _those_ can use regular Hugo functions. So let's just introduce a shortcode to access the site parameters. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 651de52 commit 5ceb024

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

layouts/shortcodes/site-param.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{/* from https://stackoverflow.com/a/70172912/1860823 */}}{{ $v := .Site.Params }}{{ range (split (.Get 0) ".") }}{{ $v = index $v (.) }}{{ end }}{{ $v }}

0 commit comments

Comments
 (0)