{{- $cite := default .Params.cite ( .Scratch.Get "cite" ) -}} {{- $title := default .Params.title ( .Scratch.Get "title" ) -}} {{- $titleLang := default .Params.titleLang ( .Scratch.Get "titleLang" ) -}} {{- $titleTr := default .Params.titleTr ( .Scratch.Get "titleTr" ) -}} {{- $schemaType := default .Params.schemaType ( .Scratch.Get "schemaType" ) -}} {{- if ( and ( isset .Params "citeStyle" ) ( not ( in ( slice "inherit" "enquote" "normal" ) .Params.citeStyle ) ) ) -}} {{- erroridf "invalid-citeStyle" "Invalid `citeStyle` value %q for %q" .Params.citeStyle $title -}} {{- end -}} {{- if ( and $schemaType ( not ( in $.Site.Data.itemtypes $schemaType ) ) ) -}} {{- erroridf "invalid-schemaType" "Invalid Schema.org type value %q for %q" $schemaType $title -}} {{- end -}} {{- if ( or $titleLang $titleTr ) -}} {{- if ( not ( and $titleLang $titleTr ) ) -}} {{- erroridf "invalid-foreign-title" "Must have both title translation and language set for foreign language title %q" $title -}} {{- end -}} {{- end -}} {{- $itemType := default "CreativeWork" $schemaType -}} {{- if ( or ( in $.Site.Data.itemtypes $itemType ) ( eq .Params.suppress "true" ) ) -}} {{- with .Params.href -}} {{- end -}} {{- with $cite -}} {{- end -}} {{- if $titleLang -}} {{- end -}} {{- ( default $title .Params.shortTitle ) | markdownify | safeHTML -}} {{- if $titleLang -}} {{- end -}} {{- /**/ -}} {{- with .Params.href -}} {{- end -}} {{- else -}} {{- erroridf "invalid-schema-type" "Invalid Schema.org type value %q for %q" $itemType $title -}} {{- end -}}