mirror of https://github.com/jpanther/congo.git
🥅 Catch any cases where resources don't exist
parent
b114f3be73
commit
5575d2b43e
|
@ -1,15 +1,23 @@
|
|||
{{ define "main" }}
|
||||
{{ partial "section-heading.html" . }}
|
||||
<section>
|
||||
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
|
||||
{{ if $.Site.Params.list.groupByYear }}
|
||||
<h2 class="mt-12 text-2xl font-bold first:mt-8">{{ .Key }}</h2>
|
||||
<hr class="border-gray-400 border-dotted w-36" />
|
||||
{{ if gt .Pages 0 }}
|
||||
<section>
|
||||
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
|
||||
{{ if $.Site.Params.list.groupByYear }}
|
||||
<h2 class="mt-12 text-2xl font-bold first:mt-8">{{ .Key }}</h2>
|
||||
<hr class="border-gray-400 border-dotted w-36" />
|
||||
{{ end }}
|
||||
{{ range .Pages }}
|
||||
{{ partial "article-link.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ range .Pages }}
|
||||
{{ partial "article-link.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</section>
|
||||
{{ partial "pagination.html" . }}
|
||||
</section>
|
||||
{{ partial "pagination.html" . }}
|
||||
{{ else }}
|
||||
<section class="mt-10 prose dark:prose-light">
|
||||
<p class="py-8 border-t">
|
||||
<em>There's no articles to list here yet.</em>
|
||||
</p>
|
||||
</section>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
<span class="relative inline-block align-text-bottom icon">
|
||||
{{ $icon := resources.Get (print "icons/" . ".svg") }}
|
||||
{{ $icon.Content | safeHTML }}
|
||||
{{ if $icon }}
|
||||
{{ $icon.Content | safeHTML }}
|
||||
{{ end }}
|
||||
</span>
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
<span class="relative inline-block align-text-bottom icon">
|
||||
{{ $icon := resources.Get (print "icons/" . ".svg") }}
|
||||
{{ $icon.Content | safeHTML }}
|
||||
{{ $icon := resources.Get (printf "icons/%s.svg" ($.Get 0)) }}
|
||||
{{ if $icon }}
|
||||
{{ $icon.Content | safeHTML }}
|
||||
{{ else }}
|
||||
<em>Icon not found.</em>
|
||||
{{ end }}
|
||||
</span>
|
||||
|
|
Loading…
Reference in New Issue