forked from HugoBlox/hugo-blox-builder
/
publications.html
46 lines (41 loc) · 1.82 KB
/
publications.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{{ $ := .root }}
{{ $page := .page }}
{{ $pubs_len := len (where $.Site.RegularPages "Type" "publication") }}
<!-- Publications widget -->
<div class="row">
<div class="col-xs-12 col-md-4 section-heading">
<h1>{{ with $page.Title }}{{ . | markdownify }}{{ end }}</h1>
{{ with $page.Params.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
{{ if gt $pubs_len $page.Params.count }}
<p class="view-all">
<a href="{{ ($.Site.GetPage "section" "publication").Permalink }}">
{{ i18n "more_publications" | markdownify }}
<i class="fas fa-angle-double-right"></i>
</a>
</p>
{{ end }}
</div>
<div class="col-xs-12 col-md-8">
{{ with $page.Content }}<p>{{ . | markdownify }}</p>{{ end }}
{{ if and ($page.Params.publication_type) (ne $page.Params.publication_type "-1") }}
{{ $.Scratch.Set "recent_pubs" (where (where $.Site.RegularPages "Type" "publication") ".Params.publication_types" "intersect" (slice $page.Params.publication_type)) }}
{{ else }}
{{ $.Scratch.Set "recent_pubs" (where $.Site.RegularPages "Type" "publication") }}
{{ end }}
{{ if $page.Params.exclude_selected }}
{{ $.Scratch.Set "recent_pubs" ( ($.Scratch.Get "recent_pubs") | intersect (where (where $.Site.RegularPages "Type" "publication") ".Params.selected" "!=" true) ) }}
{{ end }}
{{ $recent_pubs := $.Scratch.Get "recent_pubs" }}
{{ range first $page.Params.count $recent_pubs }}
{{ if eq $page.Params.list_format 1 }}
{{ partial "publication_li_detailed" . }}
{{ else if eq $page.Params.list_format 2 }}
{{ partial "publication_li_apa" . }}
{{ else if eq $page.Params.list_format 3 }}
{{ partial "publication_li_mla" . }}
{{ else }}
{{ partial "publication_li_simple" . }}
{{ end }}
{{ end }}
</div>
</div>