matrix-spec/layouts/shortcodes/rver-fragment.html
Richard van der Hoff 740770a308 Add some "[Changed in this version]" for individual auth rules
For rooms v7 and v8, we can decorate individual auth rules to show what has
changed.
2022-10-04 18:06:47 +01:00

27 lines
1.1 KiB
HTML

{{/*
This template is used to render a "room version fragment". Fragments are blocks of
text which describe a portion of the room version specification. They should be
prefixed with the room version which introduces the fragment, and be reusable for
two or more versions.
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 }}
{{ $page := .Site.GetPage (path.Join .Page.File.Dir "fragments" (printf "%s%s" $name ".md"))}}
{{ $content := $page.Content }}
{{ if not $withVersioning }}
{{ $content = (replace $content "[New in this version]" "") }}
{{ $content = (replace $content "[Changed in this version]" "") }}
{{ end }}
{{ $content | safeHTML }}