Remove withVersioning
parameter of rver-fragment
shortcode. (#1971)
This commit is contained in:
parent
1e47d7ec48
commit
48afe4faa5
3 changed files with 8 additions and 18 deletions
1
changelogs/internal/newsfragments/1971.clarification
Normal file
1
changelogs/internal/newsfragments/1971.clarification
Normal file
|
@ -0,0 +1 @@
|
|||
Remove `withVersioning` parameter of `rver-fragment` shortcode.
|
|
@ -21,7 +21,7 @@ event keeps the `redacts` property under `content`. The
|
|||
|
||||
The full redaction algorithm follows.
|
||||
|
||||
{{% rver-fragment name="v11-redactions" withVersioning="true" %}}
|
||||
{{% rver-fragment name="v11-redactions" %}}
|
||||
|
||||
### Event format
|
||||
|
||||
|
|
|
@ -7,23 +7,12 @@
|
|||
|
||||
The `name` parameter is the file name without extension.
|
||||
|
||||
The `withVersioning` parameter is optional and defaults to false. When true, any
|
||||
mentions of "New in this version" from the `added-in` shortcode are removed prior
|
||||
to rendering. This is useful if needing to use a fragment where part of it describes
|
||||
new functionality in a given room version but isn't new for subsequent versions.
|
||||
|
||||
*/}}
|
||||
|
||||
{{ $name := .Params.name }}
|
||||
{{ $withVersioning := .Params.withVersioning }}
|
||||
{{ $name := .Params.name -}}
|
||||
|
||||
{{ with .Site.GetPage "rooms/fragments" }}
|
||||
{{ with .Resources.GetMatch (printf "%s%s" $name ".md") }}
|
||||
{{ $content := .RenderShortcodes }}
|
||||
{{ if not $withVersioning }}
|
||||
{{ $content = (replace $content "[New in this version]" "") }}
|
||||
{{ $content = (replace $content "[Changed in this version]" "") }}
|
||||
{{ end }}
|
||||
{{ $content | safeHTML }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ with .Site.GetPage "rooms/fragments" -}}
|
||||
{{ with .Resources.GetMatch (printf "%s.md" $name) -}}
|
||||
{{ .RenderShortcodes | safeHTML }}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue