Skip to content

Commit d701754

Browse files
committed
Remove withVersioning parameter of rver-fragment shortcode.
We now detect automatically in the `added-in` and `changed-in` shortcodes whether we need to add text according to the page's room version so this parameter has become unnecessary. Moreover, forgetting to set this param can remove the text generated by the shortcodes so it is safer to just get rid of it. Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
1 parent ae3673d commit d701754

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

content/rooms/v11.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ event keeps the `redacts` property under `content`. The
2121

2222
The full redaction algorithm follows.
2323

24-
{{% rver-fragment name="v11-redactions" withVersioning="true" %}}
24+
{{% rver-fragment name="v11-redactions" %}}
2525

2626
### Event format
2727

layouts/shortcodes/rver-fragment.html

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,12 @@
77

88
The `name` parameter is the file name without extension.
99

10-
The `withVersioning` parameter is optional and defaults to false. When true, any
11-
mentions of "New in this version" from the `added-in` shortcode are removed prior
12-
to rendering. This is useful if needing to use a fragment where part of it describes
13-
new functionality in a given room version but isn't new for subsequent versions.
14-
1510
*/}}
1611

17-
{{ $name := .Params.name }}
18-
{{ $withVersioning := .Params.withVersioning }}
12+
{{ $name := .Params.name -}}
1913

20-
{{ with .Site.GetPage "rooms/fragments" }}
21-
{{ with .Resources.GetMatch (printf "%s%s" $name ".md") }}
22-
{{ $content := .RenderShortcodes }}
23-
{{ if not $withVersioning }}
24-
{{ $content = (replace $content "[New in this version]" "") }}
25-
{{ $content = (replace $content "[Changed in this version]" "") }}
26-
{{ end }}
27-
{{ $content | safeHTML }}
28-
{{ end }}
29-
{{ end }}
14+
{{ with .Site.GetPage "rooms/fragments" -}}
15+
{{ with .Resources.GetMatch (printf "%s.md" $name) -}}
16+
{{ .RenderShortcodes | safeHTML }}
17+
{{ end -}}
18+
{{ end -}}

0 commit comments

Comments
 (0)