35 lines
726 B
HTML
35 lines
726 B
HTML
|
|
<!--
|
|
Renders a role's role.
|
|
|
|
@params sc Site context.
|
|
@params pc Page context.
|
|
-->
|
|
|
|
<!-- Validation -->
|
|
|
|
{{- if ( not ( isset . "sc" ) ) -}}
|
|
{{- errorf "No site context passed" -}}
|
|
{{- end -}}
|
|
|
|
{{- if ( not ( isset . "pc" ) ) -}}
|
|
{{- errorf "No page context passed" -}}
|
|
{{- end -}}
|
|
|
|
<!-- Variable Assignment -->
|
|
|
|
{{- $role_text := "" -}}
|
|
|
|
<!-- Rendering -->
|
|
|
|
{{- if ( and ( .pc.Params.redact ) ( ne .sc.Site.Params.redact "show" ) ) -}}
|
|
{{- if ( eq .sc.Site.Params.redact "black" ) -}}
|
|
{{- $role_text = "███████████████" -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- else -}}
|
|
{{- $role_text = .pc.Title | htmlUnescape | plainify -}}
|
|
{{- end -}}
|
|
|
|
{{- return $role_text -}}
|