hugoWebsite/layouts/partials/posts-template.html

60 lines
3.3 KiB
HTML
Raw Normal View History

2022-10-29 00:20:35 +02:00
<div class="mx-auto text-gray-900 max-w-7xl dark:text-gray-50">
<div class="px-4 not-prose">
<div class="grid gap-4 mx-auto mt-12 mb-4 lg:max-w-none md:grid-cols-3">
{{ range .Paginator.Pages }}
<div class="flex flex-col overflow-hidden rounded-lg shadow-lg bg-gray-50 dark:bg-gray-900">
{{ with .Params.featured_image }}
2022-10-29 00:20:35 +02:00
{{ with resources.Get . }}
{{ $postimage := (.Resize "500x webp q90").RelPermalink }}
<a href="{{.Permalink}}">
<img src="{{ $postimage }}" class="object-fill overflow-hidden rounded-t-lg" width="100%" height=""
loading="lazy" alt="{{ .Title }}" />
</a>
2022-10-29 00:20:35 +02:00
{{ end }}
{{ end }}
<div class="p-6">
<div class="flex-1">
<a href="{{.Permalink}}"
class="block mt-2 text-2xl font-black text-gray-900 dark:text-gray-200 hover:text-indigo-600 dark:hover:text-indigo-500 hover:underline">
{{.Title}}
</a>
<p class="mt-3 text-base text-gray-900 dark:text-gray-300">
{{ .Params.summary }}
</p>
</div>
<div class="flex pt-6 font-medium text-indigo-600 dark:text-indigo-100 text-md">
2022-10-29 00:20:35 +02:00
<span class="pr-2 font-black">Tags:</span>
{{ range $elem_index, $elem_val := (.GetTerms "tags") }}
{{- if gt $elem_index 0 }}, {{ end -}}
<a href="{{ .Permalink }}"
class="inline-flex items-center rounded-md bg-gray-300 hover:bg-indigo-200 hover:text-black px-2.5 py-0.5 text-sm font-medium text-gray-900 capitalize">{{ .LinkTitle }}</a>
{{- end -}}
2022-10-29 00:20:35 +02:00
</div>
<div class="flex items-center mt-6">
<div class="flex-shrink-0">
<span class="sr-only">{{ .Params.author }}</span>
{{ with .Params.authorimage }}
{{ with resources.Get . }}
{{ $authorimage := (.Resize "400x webp").RelPermalink }}
<img class="w-10 h-10 rounded-full" src="{{ $authorimage }}" alt="">
{{ end }}
{{ end }}
2022-10-29 00:20:35 +02:00
</div>
<div class="pt-1 ml-3">
<p class="text-sm font-medium text-gray-900 dark:text-white">
{{ .Params.author }}
2022-10-29 00:20:35 +02:00
</p>
<div class="flex space-x-1 text-sm text-gray-500 dark:text-white">
2022-10-29 00:20:35 +02:00
<time datetime="2020-02-12">{{.Date.Format "2006-01-02"}}</time>
<span aria-hidden="true">&middot;</span>
<span>{{ math.Round (div (countwords .Content) 220.0) }}
min read</span>
2022-10-29 00:20:35 +02:00
</div>
</div>
</div>
</div>
</div>
{{ end }}
</div>
</div>
</div>