|
108 | 108 |
|
109 | 109 | {{- range where $bibliography "id" "eq" $key -}} |
110 | 110 | {{- $currentRef := . -}} |
| 111 | + <span class="hugo-cite-group"> |
111 | 112 |
|
112 | | - {{/* Add to the collection of cited references */}} |
113 | | - {{- $.Page.Scratch.SetInMap "citedBib" $key $currentRef -}} |
| 113 | + {{/* Add to the collection of cited references */}} |
| 114 | + {{- $.Page.Scratch.SetInMap "citedBib" $key $currentRef -}} |
114 | 115 |
|
115 | | - {{/* Add to the collection of cited references */}} |
116 | | - {{- $.Page.Scratch.SetInMap "citedBib" $key $currentRef -}} |
| 116 | + {{/* Add to the collection of cited references */}} |
| 117 | + {{- $.Page.Scratch.SetInMap "citedBib" $key $currentRef -}} |
117 | 118 |
|
118 | | - <a href="#{{- $key | urlize -}}"><span class="visually-hidden">Citation: </span> |
119 | | - {{- $reference := . -}} |
| 119 | + <a href="#{{- $key | urlize -}}"><span class="visually-hidden">Citation: </span> |
| 120 | + {{- $reference := . -}} |
120 | 121 |
|
121 | | - {{- /* -------------------- BEGIN Display authors -------------------- */ -}} |
122 | | - {{- if not $suppressAuthor -}} |
123 | | - {{- $displayAuthors := $reference.author -}} |
124 | | - {{- if not $reference.author -}} |
125 | | - {{- $displayAuthors = $reference.editor -}} |
126 | | - {{- end -}} |
127 | | - {{- if not $displayAuthors -}} |
128 | | - <span rel="noauthor"> |
129 | | - {{- i18n "apa_no_author_abbr" | default "n.a." | upper -}} |
130 | | - </span> |
131 | | - {{- else -}} |
132 | | - {{- range $authorIndex, $author := $displayAuthors | first 2 -}} |
133 | | - <span itemprop="author" itemscope itemtype="https://schema.org/Person"> |
134 | | - {{- with $author.given -}} |
135 | | - <meta itemprop="givenName" content="{{ . }}"> |
| 122 | + {{- /* -------------------- BEGIN Display authors -------------------- */ -}} |
| 123 | + {{- if not $suppressAuthor -}} |
| 124 | + {{- $displayAuthors := $reference.author -}} |
| 125 | + {{- if not $reference.author -}} |
| 126 | + {{- $displayAuthors = $reference.editor -}} |
| 127 | + {{- end -}} |
| 128 | + {{- if not $displayAuthors -}} |
| 129 | + <span rel="noauthor"> |
| 130 | + {{- i18n "apa_no_author_abbr" | default "n.a." | upper -}} |
| 131 | + </span> |
| 132 | + {{- else -}} |
| 133 | + {{- range $authorIndex, $author := $displayAuthors | first 2 -}} |
| 134 | + <span itemprop="author" itemscope itemtype="https://schema.org/Person"> |
| 135 | + {{- with $author.given -}} |
| 136 | + <meta itemprop="givenName" content="{{ . }}"> |
| 137 | + {{- end -}} |
| 138 | + {{- with $author.family -}} |
| 139 | + <span itemprop="familyName">{{ . | markdownify }}</span> |
| 140 | + {{- end -}} |
| 141 | + </span> |
| 142 | + {{- if and (eq $authorIndex 0) (gt (len $displayAuthors) 2) -}} |
| 143 | + ,  |
136 | 144 | {{- end -}} |
137 | | - {{- with $author.family -}} |
138 | | - <span itemprop="familyName">{{ . | markdownify }}</span> |
| 145 | + {{- if and (eq (len $displayAuthors) 2) (eq $authorIndex 0) -}} &  |
139 | 146 | {{- end -}} |
140 | | - </span> |
141 | | - {{- if and (eq $authorIndex 0) (gt (len $displayAuthors) 2) -}} |
142 | | - ,  |
143 | 147 | {{- end -}} |
144 | | - {{- if and (eq (len $displayAuthors) 2) (eq $authorIndex 0) -}} &  |
| 148 | + {{ if gt (len $displayAuthors) 2 }} |
| 149 | + <em>& al.</em> |
| 150 | + {{- end -}} |
| 151 | + {{- end -}},  |
| 152 | + {{- end -}} |
| 153 | + {{- /* -------------------- END Display authors -------------------- */ -}} |
| 154 | + |
| 155 | + {{- if and (isset $reference "issued") (isset $reference.issued "date-parts") -}} |
| 156 | + {{- range $index, $dateParts := (index .issued "date-parts") -}}{{/* range of dates */}} |
| 157 | + {{- range first 1 $dateParts -}}{{/* First element in date-part is the year */ -}} |
| 158 | + <span itemprop="datePublished"> |
| 159 | + {{- . -}} |
| 160 | + </span> |
145 | 161 | {{- end -}} |
146 | | - {{- end -}} |
147 | | - {{ if gt (len $displayAuthors) 2 }} |
148 | | - <em>& al.</em> |
149 | | - {{- end -}} |
150 | | - {{- end -}},  |
151 | | - {{- end -}} |
152 | | - {{- /* -------------------- END Display authors -------------------- */ -}} |
153 | | - |
154 | | - {{- if and (isset $reference "issued") (isset $reference.issued "date-parts") -}} |
155 | | - {{- range $index, $dateParts := (index .issued "date-parts") -}}{{/* range of dates */}} |
156 | | - {{- range first 1 $dateParts -}}{{/* First element in date-part is the year */ -}} |
157 | | - <span itemprop="datePublished"> |
158 | | - {{- . -}} |
159 | | - </span> |
160 | 162 | {{- end -}} |
161 | 163 | {{- end -}} |
162 | | - {{- end -}} |
163 | | - {{- $currentPages := index $pages $keyIndex -}} |
164 | | - {{- with $currentPages -}},  |
165 | | - {{- $formatedPages := (printf "p. %s" $currentPages) | safeHTML -}} |
166 | | - {{- if gt (findRE "-" $currentPages) 0 -}}{{/* If `$pages` contains a dash */}} |
167 | | - {{- $formatedPages = (printf "pp. %s" $currentPages) | safeHTML -}} |
168 | | - {{- end -}} |
169 | | - {{- $formatedPages }}{{- end -}} |
170 | | - </a> |
171 | | - |
172 | | - {{- /* Eliminate space between css-hidden citation hover block */ -}} |
173 | | - |
174 | | - <span class="hugo-cite-citation"> {{ partial $partialPath $reference }}</span> |
| 164 | + {{- $currentPages := index $pages $keyIndex -}} |
| 165 | + {{- with $currentPages -}},  |
| 166 | + {{- $formatedPages := (printf "p. %s" $currentPages) | safeHTML -}} |
| 167 | + {{- if gt (findRE "-" $currentPages) 0 -}}{{/* If `$pages` contains a dash */}} |
| 168 | + {{- $formatedPages = (printf "pp. %s" $currentPages) | safeHTML -}} |
| 169 | + {{- end -}} |
| 170 | + {{- $formatedPages }}{{- end -}} |
| 171 | + </a> |
| 172 | + |
| 173 | + {{- /* Eliminate space between css-hidden citation hover block */ -}} |
| 174 | + |
| 175 | + <span class="hugo-cite-citation"> {{ partial $partialPath $reference }}</span></span> |
175 | 176 |
|
176 | 177 | {{- if lt (add 1 $keyIndex) $totalRefs -}}; {{- end -}} |
177 | 178 |
|
|
0 commit comments