|
14 | 14 | .abstractContent {
|
15 | 15 | padding: 5px;
|
16 | 16 | margin: 0 5px 0 15px;
|
17 |
| - display: none; |
18 |
| - font-size: 0.9rem; |
19 |
| - overflow: hidden; |
20 |
| - background-color: #e8e8ff; |
| 17 | + font-size: 1.0rem; |
21 | 18 | clear: both;
|
22 | 19 | }
|
23 | 20 |
|
|
30 | 27 | color: white;
|
31 | 28 | }
|
32 | 29 |
|
33 |
| -.bibTitle { |
34 |
| - font-weight: 700; |
35 |
| -} |
36 |
| - |
37 |
| -.authors { margin: 5px auto 2px 5px; } |
38 |
| - |
39 | 30 | .tooltipNotes {
|
40 | 31 | position: relative;
|
41 | 32 | display: inline-block;
|
|
145 | 136 | border-color: #555 transparent transparent transparent;
|
146 | 137 | }
|
147 | 138 |
|
| 139 | +.label { |
| 140 | + font-weight: 700; |
| 141 | +} |
| 142 | + |
148 | 143 | </style>
|
149 | 144 |
|
150 |
| -{{ $notesIcon := "\u24C3" }} |
151 |
| -{{ $nonBreakingHyphen := "\u2011" }} |
| 145 | +{{- $notesIcon := "\u24C3" -}} |
| 146 | +{{- $nonBreakingHyphen := "\u2011" -}} |
152 | 147 | <script>
|
153 | 148 | var abstractExpanderOpen = "Abstract \u25BC";
|
154 | 149 | var abstractExpanderClose = "Abstract \u25B2";
|
| 150 | +</script> |
155 | 151 |
|
156 |
| -/* |
157 |
| -var abstractExpanderOpen = "Abstract +"; |
158 |
| -var abstractExpanderClose = "Abstract -"; |
159 |
| -*/</script> |
160 |
| - |
161 |
| -<table style="max-width: 100%"> |
162 |
| - <thead> |
163 |
| - <tr> |
164 |
| - <th>Reference</th> |
165 |
| - </tr> |
166 |
| - </thead> |
167 |
| - <tbody style="overflow:auto"> |
168 |
| - {{ with .params.bibItem }} |
169 |
| - <tr> |
170 |
| - {{ $itemID := (cond (gt (len .id) 0) (replace .id `/` `_`) `_0`) }} |
171 |
| - <td><div class="bibTitle">{{ if .url }}<a href="{{ .url }}">{{ .title }}</a>{{ else }}{{ .title }}{{ end }}</div> |
172 |
| - {{ if or .author .editor }}<div class="authors">{{ if not .author }}<i>Edited by: </i>{{ end }}{{ range $naE, $auEd := or .author .editor }}{{ if $naE }}; {{ end }}{{ if $auEd.literal }}{{ $auEd.literal }}{{ else if and $auEd.family $auEd.given }}{{ $auEd.family }}, {{ $auEd.given }}{{ else }}{{ $auEd.family }}{{ $auEd.given }}{{ end }}{{ end }} |
173 |
| - </div>{{ end }} |
174 |
| - {{ if .abstract }}<button type="button" class="abstractExpander left" id="A{{$itemID}}">AAA</button>{{ end }} |
175 |
| - {{ if and false .note }} |
176 |
| - {{ $notes := split (plainify .note) "\n" }} |
177 |
| - <div class="tooltipNotes right" id="N{{$itemID}}">Notes |
178 |
| - <span class="tooltipNotesText tooltipNotes-left" id="N{{$itemID}}_Text"> |
179 |
| - {{ range $nn, $note := $notes }} |
180 |
| - {{if strings.ContainsNonSpace $note }} |
181 |
| - {{ if $nn }}<br>{{ end }} |
182 |
| - {{ print (safeJS (replace (replace (htmlUnescape $note) "-" $nonBreakingHyphen) " " " ")) }} |
183 |
| - {{ end }} |
184 |
| - {{ end }}</span></div> |
185 |
| - {{ end }} |
186 |
| - {{ if .abstract }}<br><div class="abstractContent" id="A{{$itemID }}_Abs"> |
187 |
| - {{ range $na, $abstract := split (plainify .abstract) "\n" }} |
188 |
| - {{if strings.ContainsNonSpace $abstract }} |
189 |
| - {{ if $na }}<br>{{ end }} |
190 |
| - {{ $trimmed := strings.TrimLeft " " $abstract }}{{ $indent := (sub ($abstract | len) ($trimmed | len)) }} |
191 |
| - {{ print (safeJS (htmlUnescape (printf "%s" $trimmed | printf "%s%s" (strings.Repeat $indent " ") | printf "%s"))) }} |
192 |
| - {{ end }} |
193 |
| - {{ end }} |
194 |
| - </div>{{ end }}</td> |
195 |
| - </tr> |
196 |
| - {{ end }} |
197 |
| - </tbody> |
198 |
| - |
199 |
| -</table> |
| 152 | +{{ $item := dict -}} |
| 153 | +{{- $jsonFile := printf "data/bibItems/%s.json" (.Get "key") -}} |
| 154 | +{{- $bib := resources.Get $jsonFile -}} |
| 155 | +{{- with $bib -}} |
| 156 | + {{- with . | transform.Unmarshal -}} |
| 157 | + {{- $item = . -}} |
| 158 | + {{- end -}} |
| 159 | +{{- else -}} |
| 160 | + {{- $jsonFile | errorf "Unable to get item resource '%s'" -}} |
| 161 | +{{- end -}} |
| 162 | +{{- with $item -}} |
| 163 | + {{- if or .author .editor -}} |
| 164 | + <h3> |
| 165 | + {{- if not .author -}}<i>Edited by: </i>{{- end -}} |
| 166 | + {{- range $naE, $auEd := or .author .editor -}} |
| 167 | + {{- if $naE -}}; {{ end -}} |
| 168 | + {{- if $auEd.literal -}} |
| 169 | + {{- $auEd.literal -}} |
| 170 | + {{- else if and $auEd.family $auEd.given -}} |
| 171 | + {{- $auEd.family -}}, {{- $auEd.given -}} |
| 172 | + {{- else -}} |
| 173 | + {{- $auEd.family -}}{{- $auEd.given -}} |
| 174 | + {{- end -}} |
| 175 | + {{- end -}} |
| 176 | + </h3> |
| 177 | + {{- end -}} |
| 178 | + {{- if .url }} |
| 179 | + <h3><a href="{{- .url -}}">Access document</a></h3> |
| 180 | + {{ end -}} |
| 181 | + {{- if eq .itemType "journalArticle" -}} |
| 182 | + {{- $journalTitle := or .publicationTitle .journalAbbreviation -}} |
| 183 | + {{- if $journalTitle }} |
| 184 | +<br><span class="label">Publication:</span> {{ $journalTitle -}} |
| 185 | + {{- end -}} |
| 186 | + {{- if .volume }} |
| 187 | +<br><span class="label">Volume:</span> {{ .volume -}} |
| 188 | + {{- end -}} |
| 189 | + {{- if .issue }} |
| 190 | +<br><span class="label">Issue:</span> {{ .issue -}} |
| 191 | + {{- end -}} |
| 192 | + {{- $date := "" -}} |
| 193 | + {{- if .issuedDateParts -}} |
| 194 | + {{- $dp := .issuedDateParts -}} |
| 195 | + {{- $dpl := len $dp -}} |
| 196 | + {{- $dpf := "January 1, 1900" -}} |
| 197 | + {{- $y := 0 -}} |
| 198 | + {{- $m := 10 -}} |
| 199 | + {{- $d := 18 -}} |
| 200 | + {{- if ge $dpl 1 -}} |
| 201 | + {{- $y := strings.TrimLeft "0" (string (index $dp 0)) | int -}} |
| 202 | + {{- $dpf := "1900" -}} |
| 203 | + {{- end -}} |
| 204 | + {{- if ge $dpl 2 -}} |
| 205 | + {{- $m := strings.TrimLeft "0" (string (index $dp 1)) | int -}} |
| 206 | + {{- $dpf := "January 1900" -}} |
| 207 | + {{- end -}} |
| 208 | + {{- if ge $dpl 3 -}} |
| 209 | + {{- $d := strings.TrimLeft "0" (string (index $dp 2)) | int -}} |
| 210 | + {{- $dpf := "January 1, 1900" -}} |
| 211 | + {{- end -}} |
| 212 | + {{- if $y -}} |
| 213 | + {{- $t := printf "%4d-%2d-%2d" $y $m $d -}} |
| 214 | + {{- $dp := time.AsTime $t -}} |
| 215 | + {{- $date := $dp.Format $dpf -}} |
| 216 | + {{- end -}} |
| 217 | + {{- end -}} |
| 218 | + {{- if and (not $date) .date -}} |
| 219 | + {{- $date := .date -}} |
| 220 | + {{- end -}} |
| 221 | + {{- if $date }} |
| 222 | +<br><span class="label">Date:</span> {{ $date -}} |
| 223 | + {{- end -}} |
| 224 | + {{- $pages := or .pages .page -}} |
| 225 | + {{- if $pages }} |
| 226 | +<br><span class="label">Pages:</span> {{ $pages -}} |
| 227 | + {{- end -}} |
| 228 | + {{- end -}} |
| 229 | + {{- if .DOI }} |
| 230 | +<br><span class="label">DOI:</span> {{ .DOI -}} |
| 231 | + {{- end -}} |
| 232 | + {{- if .ISSN }} |
| 233 | +<br><span class="label">ISSN:</span> {{ .ISSN -}} |
| 234 | + {{- end -}} |
| 235 | + {{- if .abstract }} |
| 236 | +<br><span class="label">Abstract:</span><br><div class="abstractContent"> |
| 237 | + {{- range $na, $abstract := split (plainify .abstract) "\n" -}} |
| 238 | + {{- if $na -}}<br>{{- end -}} |
| 239 | + {{if strings.ContainsNonSpace $abstract -}} |
| 240 | + {{- $trimmed := strings.TrimLeft " " $abstract -}}{{- $indent := (sub ($abstract | len) ($trimmed | len)) -}} |
| 241 | + {{- print (safeJS (htmlUnescape (printf "%s" $trimmed | printf "%s%s" (strings.Repeat $indent " ") | printf "%s"))) -}} |
| 242 | + {{- end -}} |
| 243 | + {{- end -}} |
| 244 | +</div> |
| 245 | + {{ end -}} |
| 246 | + {{- if and false .note -}} |
| 247 | + {{- $itemID := (cond (gt (len .id) 0) (replace .id `/` `_`) `_0`) -}} |
| 248 | + {{- $notes := split (plainify .note) "\n" -}} |
| 249 | + <div class="tooltipNotes right" id="N{{$itemID}}">Notes |
| 250 | + <span class="tooltipNotesText tooltipNotes-left" id="N{{$itemID}}_Text"> |
| 251 | + {{- range $nn, $note := $notes -}} |
| 252 | + {{if strings.ContainsNonSpace $note -}} |
| 253 | + {{- if $nn -}}<br>{{- end -}} |
| 254 | + {{- print (safeJS (replace (replace (htmlUnescape $note) "-" $nonBreakingHyphen) " " " ")) -}} |
| 255 | + {{- end -}} |
| 256 | + {{- end -}} |
| 257 | + </span> |
| 258 | + </div> |
| 259 | + {{- end -}} |
| 260 | +{{- end -}} |
| 261 | +<br><hr><br> |
200 | 262 | <script>
|
201 | 263 | function abstractExpanderClick() {
|
202 | 264 | this.classList.toggle("active");
|
|
0 commit comments