diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 1c8b0fb..e208167 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,15 +1,23 @@ {{ define "main" }} {{ partial "section-heading.html" . }} - - {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} - {{ if $.Site.Params.list.groupByYear }} - {{ .Key }} - + {{ if gt .Pages 0 }} + + {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} + {{ if $.Site.Params.list.groupByYear }} + {{ .Key }} + + {{ end }} + {{ range .Pages }} + {{ partial "article-link.html" . }} + {{ end }} {{ end }} - {{ range .Pages }} - {{ partial "article-link.html" . }} - {{ end }} - {{ end }} - - {{ partial "pagination.html" . }} + + {{ partial "pagination.html" . }} + {{ else }} + + + There's no articles to list here yet. + + + {{ end }} {{ end }} diff --git a/layouts/partials/icon.html b/layouts/partials/icon.html index 6c53251..cde57b9 100644 --- a/layouts/partials/icon.html +++ b/layouts/partials/icon.html @@ -1,4 +1,6 @@ {{ $icon := resources.Get (print "icons/" . ".svg") }} - {{ $icon.Content | safeHTML }} + {{ if $icon }} + {{ $icon.Content | safeHTML }} + {{ end }} diff --git a/layouts/shortcodes/icon.html b/layouts/shortcodes/icon.html index 6c53251..e9251ea 100644 --- a/layouts/shortcodes/icon.html +++ b/layouts/shortcodes/icon.html @@ -1,4 +1,8 @@ - {{ $icon := resources.Get (print "icons/" . ".svg") }} - {{ $icon.Content | safeHTML }} + {{ $icon := resources.Get (printf "icons/%s.svg" ($.Get 0)) }} + {{ if $icon }} + {{ $icon.Content | safeHTML }} + {{ else }} + Icon not found. + {{ end }}
+ There's no articles to list here yet. +