loup-brun / hugo-cite

📝 Easily manage your bibliography and in-text citations with Hugo, the popular static-site generator.
https://labs.loupbrun.ca/hugo-cite/
Do What The F*ck You Want To Public License
108 stars 27 forks source link

APA 6th template for Reports #31

Closed HughP closed 3 years ago

HughP commented 3 years ago

Greetings,

I worked out the template for reports. Three notes:

  1. I could send these over as PRs but I don't want to clog the PR flow if there is no intent of using them, or they will be rejected. further instruction is needed in this regard.
  2. In contrast to my previous template for Thesis works #30 I created a template for if archive metadata is present in the CSL. this is referenced just like the authorPart and DOIpart templates. and is included below
  3. Issue #26 points out that corporate authors are not handled by the authorPart. Many Reports have Institutional authors. So many reports are going to show "no author" until the authorPart is revised.
{{/* BEGIN ArchivalID */}}
{{- define "ArchivalID" }}
{{ if isset . "archive" -}}&#32; Available from <meta itemprop="Organization" itemtype="http://schema.org/Organization"
             itemscope><span itemprop="name">{{- echoParam . "archive" -}}</span>.&#32; ({{- if isset . "archive_location" -}}{{- echoParam . "archive_location" -}}{{- end }}</span>)</span>.
  {{- end -}}
{{- end }}
{{/* END ArchivalID */}}
{{/* -------------------- BEGIN REPORT TYPE -------------------- */}}
{{- else if eq .type "report" -}}
<span itemscope
      itemtype="https://schema.org/Report"
      data-type="report">
  {{- template "authorPart" . }}
  &#32;
  {{- template "issuedPart" . }}.
  &#32;
  {{- if .title -}}
  <span itemprop="name">
    <i>{{- .title | markdownify -}}</i>
  </span>
  {{- end -}}
{{- if isset . "number" -}}<span itemprop="reportNumber">&nbsp;({{- echoParam . "number" -}})</span>
    {{- end -}}.&nbsp;
{{ if isset . "publisher-place" -}}
  <meta itemprop="contentLocation"
        value="{{- echoParam . "publisher-place" -}}">
  {{- end -}}
  {{- with .publisher -}}
  <span itemprop="Organization"
             itemtype="http://schema.org/Organization"
             itemscope>
    <span itemprop="name">
      {{- . -}}{{- end -}}
    </span> {{ if isset . "publisher-place" -}}:&#32; <span itemprop="location">{{- echoParam . "publisher-place" -}}</span></span>.
  {{- end }}
  {{- template "ArchivalID" . -}}
  {{- template "DOIPart" . -}}
</span>
{{/* -------------------- END REPORT TYPE -------------------- */}}