Skip to content

Instantly share code, notes, and snippets.

@p-ang
Last active January 23, 2020 01:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save p-ang/d536917828822f23cabfe28bfdfc7aa2 to your computer and use it in GitHub Desktop.
Save p-ang/d536917828822f23cabfe28bfdfc7aa2 to your computer and use it in GitHub Desktop.
{{ $query1 := where (where .Pages ".IsNode" false) ".Type" "publication" }}
{{ $col_pub := slice }}
{{ $col_pr := slice }}
{{ $col_conf := slice }}
{{ $col_ch := slice }}
{{ range $item := $query1 }}
{{with (index .Params.publication_types 0) }}
{{ if eq . "2" }}
{{ $col_pub = $col_pub | append $item }}
{{ else if eq . "1" }}
{{ $col_conf = $col_conf | append $item }}
{{ else if eq . "3" }}
{{ $col_pr = $col_pr | append $item }}
{{ else if eq . "6" }}
{{ $col_ch = $col_ch | append $item }}
{{ end }}
{{end}}
{{ end }}
<div class="article-widget">
{{ if (len $col_pub) }}
<div class="hr-light"></div>
<h3>Publications</h3>
<ul>
{{ range $col_pub }}
<li>{{ partial "li_citation" . }}</li>
{{ end }}
</ul>
</div>
{{ end }}
{{ if (len $col_pr) }}
<div class="hr-light"></div>
<h3>Preprints</h3>
<ul>
{{ range $col_pr }}
<li>{{ partial "li_citation" . }}</li>
{{ end }}
</ul>
{{ end }}
{{ if (len $col_conf) }}
<div class="hr-light"></div>
<h3>Conference Papers</h3>
<ul>
{{ range $col_conf }}
<li>{{ partial "li_citation" . }}</li>
{{ end }}
</ul>
{{ end }}
{{ if (len $col_ch) }}
<div class="hr-light"></div>
<h3>Book Chapters</h3>
<ul>
{{ range $col_ch }}
<li>{{ partial "li_citation" . }}</li>
{{ end }}
</ul>
{{ end }}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment