Files
hugo/layouts/partials/research/publication-entry.html
T

76 lines
2.7 KiB
HTML

{{- $p := .pub -}}
{{- $prefix := .prefix -}}
{{- $page := false -}}
{{- with $p.page -}}
{{- $page = site.GetPage (printf "/research/%s" .) -}}
{{- end -}}
{{- $links := slice -}}
{{- with $page }}{{ $links = $links | append (printf "<a href=\"%s\">Page</a>" .RelPermalink) }}{{ end -}}
{{- $pdf := "" -}}
{{- if $page }}
{{- with $page.Resources.Match "{paper,journal}/*.pdf" }}
{{- range first 1 . }}
{{- $pdf = .RelPermalink -}}
{{- end }}
{{- end }}
{{- end -}}
{{- if not $pdf }}{{ $pdf = $p.pdf }}{{ end -}}
{{- with $pdf }}{{ $links = $links | append (printf "<a href=\"%s\">PDF</a>" .) }}{{ end -}}
{{- $poster := "" -}}
{{- if $page }}
{{- with $page.Resources.Match "poster/*.pdf" }}
{{- range first 1 . }}
{{- $poster = .RelPermalink -}}
{{- end }}
{{- end }}
{{- end -}}
{{- if not $poster }}{{ $poster = $p.poster }}{{ end -}}
{{- with $poster }}{{ $links = $links | append (printf "<a href=\"%s\">Poster</a>" .) }}{{ end -}}
{{- $slides := "" -}}
{{- if $page }}
{{- with $page.Resources.Match "talk/*.pdf" }}
{{- range first 1 . }}
{{- $slides = .RelPermalink -}}
{{- end }}
{{- end }}
{{- end -}}
{{- if not $slides }}{{ $slides = $p.slides }}{{ end -}}
{{- with $slides }}{{ $links = $links | append (printf "<a href=\"%s\">Slides</a>" .) }}{{ end -}}
{{- with $p.code }}{{ $links = $links | append (printf "<a href=\"%s\">Code</a>" .) }}{{ end -}}
{{- with $p.video }}{{ $links = $links | append (printf "<a href=\"%s\">Video</a>" .) }}{{ end -}}
{{- with $p.doi }}{{ $links = $links | append (printf "<a href=\"https://doi.org/%s\">DOI</a>" .) }}{{ end -}}
<div class="pub-item">
<div class="pub-header">
<span class="pub-prefix">[{{ $prefix }}]</span>
{{- with $page -}}
<a href="{{ .RelPermalink }}" class="pub-title">{{ $p.title }}</a>
{{- else -}}
<strong class="pub-title">{{ $p.title }}</strong>
{{- end -}}
{{- with $p.note }}<span class="pub-note">{{ . }}</span>{{ end }}
</div>
<div class="pub-meta">
{{- range $i, $a := $p.authors -}}
{{- if $i }}, {{ end -}}
{{- if eq $a "T. Dehaeze" -}}<strong>{{ $a }}</strong>{{ else }}{{ $a }}{{ end -}}
{{- end -}}.
{{- $vol := $p.volume -}}
{{- $num := $p.number -}}
{{- $pages := $p.pages -}}
{{- $year := $p.year -}}
{{- $hasDetail := or $vol $num $pages -}}
{{- with $p.venue }} <em>{{ . }}</em>{{ end -}}
{{- if and $p.venue $hasDetail }},{{ end -}}
{{- if and $vol $num }} {{ $vol }}({{ $num }}){{ else if $vol }} {{ $vol }}{{ end -}}
{{- if $pages }}{{ if or $vol $num }}:{{ else if $p.venue }} {{ end }}{{ $pages }}{{ end -}}
{{- if $year }}{{ if $hasDetail }},{{ end }} {{ $year }}{{ end -}}.
</div>
{{ partial "research/link-row.html" $links }}
</div>