{{- $abbr := .Get 0 -}}
{{- $mode := default "shortTitle" ( .Get 1 ) -}}
{{- with ( index $.Site.Data.abbreviations $abbr ) -}}
{{- if ( or ( eq $mode "shortTitle" ) ( eq $mode "shortTitlePl" ) ) -}}
{{- if ( eq $mode "shortTitle" ) -}}
{{- .shortTitle | safeHTML -}}
{{- else if ( eq $mode "shortTitlePl" ) -}}
{{- with .shortTitlePl -}}{{- . | safeHTML -}}{{- else -}}{{- .shortTitle | safeHTML -}}s{{- end -}}
{{- end -}}
{{- else if ( or ( eq $mode "longtitle" ) ( eq $mode "longTitlePl" ) ) -}}
{{- if ( eq $mode "longTitle" ) -}}
{{- .longTitle | safeHTML -}}
{{- else if ( eq $mode "longTitlePl" ) -}}
{{- with .longTitlePl -}}{{- . | safeHTML -}}{{- else -}}{{- .longTitle | safeHTML -}}s{{- end -}}
{{- end -}}
{{- else if ( or ( eq $mode "fullTitle" ) ( eq $mode "fullTitlePl" ) ) -}}
{{- if ( eq $mode "fullTitle" ) -}}
{{- .longTitle | safeHTML -}} ({{- .shortTitle | safeHTML -}})
{{- else if ( eq $mode "fullTitlePl" ) -}}
{{- with .longTitlePl -}}{{- . | safeHTML -}}{{- else -}}{{- .longTitle | safeHTML -}}s{{- end -}}
({{- with .shortTitlePl -}}{{- . | safeHTML -}}{{- else -}}{{- .shortTitle | safeHTML -}}s{{- end -}})
{{- end -}}
{{- end -}}
{{- else -}}
{{- errorf "No definition found for abbreviation '%q'" $abbr -}}
{{- end -}}