Skip to content

Commit c08c925

Browse files
Merge pull request #6 from RejektsConference/comment_shortcode
2 parents 3d9dda3 + 5b59b37 commit c08c925

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

themes/rejekts/layouts/_shortcodes/params.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
{{/*
2+
This shortcode is used to render parameters from the site's config.yaml file within other values in the config
3+
It can be used in config like this:
4+
title: Cloud Native Rejekts {{< params event.edition >}}
5+
This will render the `event.edition` value as part of the title.
6+
7+
This shortcode also supports some helpers to format the value being referenced:
8+
* `replace` to replace a substring - e.g. `{{< params event.edition replace " " "_" >}}`
9+
* `month` to format the date as month name
10+
* `day` to format the date as day of the week
11+
* `year` to format the date as year
12+
*/}}
113
{{- $key := cond (.IsNamedParams) (.Get "key") (.Get 0) -}}
214
{{- $fn := cond (.IsNamedParams) (.Get "function") (.Get 1) -}}
315
{{- $param := (index .Site.Params (split $key ".")) -}}

0 commit comments

Comments
 (0)