fixed margin in lists and added show cards

This commit is contained in:
Nuno Coração
2022-10-02 17:03:09 +01:00
parent afd5d3508b
commit 45a62c3507
300 changed files with 15024 additions and 67 deletions
+25 -11
View File
@@ -1,7 +1,26 @@
{{ with .Params.externalUrl }}
<a class="sm:flex mb-10 article" href="{{ . }}" target="_blank" rel="external">
{{ $articleClasses := "flex flex-wrap article" }}
{{ if .Site.Params.list.showCards }}
{{ $articleClasses = delimit (slice $articleClasses "border" "border-neutral-200 dark:border-neutral-700 border-2 rounded-md") " " }}
{{ end }}
{{ $articleImageClasses := "w-full md:w-auto h-full thumbnail nozoom" }}
{{ if .Site.Params.list.showCards }}
{{ $articleImageClasses = delimit (slice $articleImageClasses "") " " }}
{{ else }}
<a class="sm:flex mb-10 article" href="{{ .RelPermalink }}">
{{ $articleImageClasses = delimit (slice $articleImageClasses "thumbnailshadow md:mr-7") " " }}
{{ end }}
{{ $articleInnerClasses := "" }}
{{ if .Site.Params.list.showCards }}
{{ $articleInnerClasses = delimit (slice $articleInnerClasses "p-4") " " }}
{{ else }}
{{ $articleInnerClasses = delimit (slice $articleInnerClasses "mt-3 md:mt-0") " " }}
{{ end }}
{{ with .Params.externalUrl }}
<a class="{{ $articleClasses }}" href="{{ . }}" target="_blank" rel="external">
{{ else }}
<a class="{{ $articleClasses }}" href="{{ .RelPermalink }}">
{{ end }}
{{- with $.Params.images -}}
{{- range first 6 . }}
@@ -12,12 +31,7 @@
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- with $featured -}}
<div class="mb-5 sm:mr-7 thumbnail nozoom"
style="background-image:url({{ $featured.Permalink }});">
<svg class="h-32 w-full bg-white text-gray-300 sm:w-32" preserveAspectRatio="none" stroke="none" fill="none"
viewBox="0 0 200 200" aria-hidden="true">
</svg>
</div>
<div class="{{ $articleImageClasses }}" style="background-image:url({{ $featured.Permalink }});"></div>
{{- else -}}
{{- with $.Site.Params.images }}
@@ -26,8 +40,8 @@
{{- end -}}
<div class="mb-[5rem] md:mb-0">
<h3 class="flex items-center text-xl font-semibold">
<div class="{{ $articleInnerClasses }}">
<h3 class="items-center text-xl font-semibold">
{{ with .Params.externalUrl }}
<div>
<div