{{ $only_file := .only_file | default false }} {{ $with_modal := and (not $only_file) .paper.Params.abstract }} {{ $modalId := printf "modal-%s" .paper.Slug }} {{ with .paper }}
{{- if $with_modal }} {{ end -}} {{- if .Params.pdf -}} {{- $file := partial "GetMedia" .Params.pdf -}} {{- $size := partial "GetHumanSize" $file.size -}} {{- $extension := partial "GetExtensionFile" $file.name -}} {{- $extension_with_size := (printf "%.2f %s - %s" $size.weight $size.unit $extension) -}} {{- $title_with_size := printf "%s (%s)" $file.name $extension_with_size -}} {{- $url := $file.url -}} {{- if site.Params.keycdn -}} {{- $url = $file.direct_url -}} {{- end -}} {{ if $file }}
{{ $extension }} - {{ $size.weight }} {{ $size.unit }}
{{ end }} {{- end -}}
{{- if $with_modal }} {{ partial "papers/modal.html" (dict "modalId" $modalId "title" .Title "abstract" .Params.abstract ) }} {{ end -}} {{ end }}