{{- /* Global citation component for resolving IssueRef elements Usage: {{ template "_citation" $issueRef }} Input: xmlmodels.IssueRef with fields: - .Nr (int): Issue number - .Von (int): Starting page - .Bis (int): Ending page (optional) - .Beilage (int): Beilage number (optional) - .When (DateAttributes): Date information Outputs: citation text + link with minimal formatting Automatically detects current page and styles accordingly */ -}} {{- $issue := . -}} {{- $issueKey := printf "%d-%d" $issue.When.Year $issue.Nr -}} {{- $issueData := GetIssue $issueKey -}} {{- $url := printf "/%s/%d" $issue.When $issue.Nr -}} {{- if $issueData -}} {{ $issueData.Datum.When.Day }}.{{ $issueData.Datum.When.Month }}.{{ $issueData.Datum.When.Year }}/{{ $issue.Nr }} {{- else -}} {{ $issue.When.Year }}/{{ $issue.Nr }} {{- end -}} {{- if $issue.Von }}, {{ if $issue.Beilage }}Beil. {{ else }}S. {{ end }}{{ $issue.Von }}{{- if and $issue.Bis (ne $issue.Von $issue.Bis) -}} -{{- $issue.Bis -}} {{- end -}} {{- end -}} {{- /* This is a dummy element to remove all whitespace at the end of the file, as some editiors will insert a newline at the end of the file, UGH. */ -}}