diff --git a/wowchemy/layouts/_default/list.html b/wowchemy/layouts/_default/list.html index 8a7389ba..9537c452 100644 --- a/wowchemy/layouts/_default/list.html +++ b/wowchemy/layouts/_default/list.html @@ -4,29 +4,20 @@
{{ with .Content }} -
{{ . }}
+
{{ . }}
{{ end }} - {{ $paginator := .Paginate .Data.Pages }} + {{ $paginator := .Paginate .Pages }} {{ range $paginator.Pages }} - {{ $link := .RelPermalink }} - {{ $target := "" }} - {{ with .Params.external_link }} - {{ $link = . }} - {{ $target = "target=\"_blank\" rel=\"noopener\"" }} + {{ if eq $.Params.view 1 }} + {{ partial "li_list" . }} + {{ else if eq $.Params.view 3 }} + {{ partial "li_card" . }} + {{ else if eq $.Params.view 4 }} + {{ partial "li_citation" . }} + {{ else }} + {{ partial "li_compact" . }} {{ end }} -
-

{{ .Title }}

-
- {{ if .Params.summary }} - {{ .Params.summary | plainify | emojify }} - {{ else if .Params.abstract }} - {{ .Params.abstract | plainify | emojify | truncate 250 }} - {{ else if .Summary }} - {{ .Summary | plainify | emojify }} - {{ end }} -
-
{{ end }} {{ partial "pagination" . }} diff --git a/wowchemy/layouts/partials/functions/has_attachments.html b/wowchemy/layouts/partials/functions/has_attachments.html index 370d000a..cff19687 100644 --- a/wowchemy/layouts/partials/functions/has_attachments.html +++ b/wowchemy/layouts/partials/functions/has_attachments.html @@ -3,10 +3,15 @@ {{ $page := . }} {{ $pdf_link := false }} -{{ $slug := $page.File.ContentBaseName }} -{{ $resource := $page.Resources.GetMatch (printf "%s.pdf" $slug) }} -{{ with $resource }} - {{ $pdf_link = true }} +{{/* Prevent Hugo warning ".File.ContentBaseName on zero object." for content not backed by a Markdown file, */}} +{{/* such as auto-generated taxonomy pages, and sections without an explicit index file. */}} +{{/* The file check is required when called from `_default/list.html`, the fallback list view for the above cases. */}} +{{ with $page.File }} + {{ $slug := $page.File.ContentBaseName }} + {{ $resource := $page.Resources.GetMatch (printf "%s.pdf" $slug) }} + {{ with $resource }} + {{ $pdf_link = true }} + {{ end }} {{ end }} {{ $cite_link := false }} diff --git a/wowchemy/layouts/partials/pagination.html b/wowchemy/layouts/partials/pagination.html index 91c521a7..6b682f17 100644 --- a/wowchemy/layouts/partials/pagination.html +++ b/wowchemy/layouts/partials/pagination.html @@ -1,5 +1,5 @@ {{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }} -