{{/*

    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.Dir "fragments" (printf "%s%s" $name ".md"))}}
{{ $content := $page.Content }}
{{ if not $withVersioning }}
    {{ $content = (replace $content "[New in this version]" "") }}
{{ end }}
{{ $content | safeHTML }}
