feat: add Prettier with go-template and toml plugins, format all files
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,36 +1,41 @@
|
||||
{{- /* Compact post card for grids.
|
||||
Expects a post page as context (.).
|
||||
*/ -}}
|
||||
Expects a post page as context (.).
|
||||
*/
|
||||
-}}
|
||||
{{- $post := . -}}
|
||||
<article class="group card-comic flex flex-col bg-concrete">
|
||||
<a href="{{ $post.RelPermalink }}" class="block flex-1 flex flex-col">
|
||||
|
||||
<!-- Thumbnail — bundle banner.png → 01.png → .Params.banner -->
|
||||
{{- $thumb := $post.Resources.GetMatch "banner.png" -}}
|
||||
{{- if not $thumb -}}{{- $thumb = $post.Resources.GetMatch "01.png" -}}{{- end -}}
|
||||
<div class="card-media aspect-editorial">
|
||||
{{- if $thumb -}}
|
||||
{{- partial "img.html" (dict "res" $thumb "widths" (slice 600 1000) "sizes" "(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 25vw" "class" "w-full h-full object-cover" "alt" $post.Title) -}}
|
||||
{{- else -}}{{- with $post.Params.banner -}}
|
||||
{{- partial "media.html" (dict "media" . "class" "w-full h-full object-cover") -}}
|
||||
{{- else -}}
|
||||
<div class="w-full h-full flex items-center justify-center halftone">
|
||||
<span class="label text-smoke text-xs">PIVOINE</span>
|
||||
</div>
|
||||
{{- end -}}{{- end -}}
|
||||
{{- with $post.Params.banner -}}
|
||||
{{- partial "media.html" (dict "media" . "class" "w-full h-full object-cover") -}}
|
||||
{{- else -}}
|
||||
<div class="w-full h-full flex items-center justify-center halftone">
|
||||
<span class="label text-smoke text-xs">PIVOINE</span>
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
<!-- Category badge — parallelogram -->
|
||||
{{- with $post.Params.categories -}}
|
||||
<div class="flex flex-wrap gap-2 px-4 pt-4">
|
||||
{{- range first 1 . -}}
|
||||
<span class="badge">{{ . }}</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2 px-4 pt-4">
|
||||
{{- range first 1 . -}}
|
||||
<span class="badge">{{ . }}</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
|
||||
<!-- Title -->
|
||||
<h3 class="font-display text-base md:text-lg text-paper text-balance leading-none group-hover:text-heat transition-colors px-4 pt-3 pb-2 flex-1">
|
||||
<h3
|
||||
class="font-display text-base md:text-lg text-paper text-balance leading-none group-hover:text-heat transition-colors px-4 pt-3 pb-2 flex-1"
|
||||
>
|
||||
{{- $post.Title -}}
|
||||
</h3>
|
||||
|
||||
@@ -42,10 +47,26 @@
|
||||
{{- $avRes := .Resources.GetMatch "avatar.*" -}}
|
||||
{{- if $avRes -}}
|
||||
{{- $av := $avRes.Resize "64x webp" -}}
|
||||
<img src="{{ $av.RelPermalink }}" alt="{{ $authorPage.Params.name | default $authorPage.Title }}" class="w-5 h-5 object-cover border border-smoke flex-shrink-0" width="{{ $av.Width }}" height="{{ $av.Height }}" loading="lazy" decoding="async">
|
||||
{{- else -}}{{- with .Params.avatar -}}
|
||||
<img src="{{ . }}" alt="{{ $authorPage.Params.name | default $authorPage.Title }}" class="w-5 h-5 object-cover border border-smoke flex-shrink-0" loading="lazy" decoding="async">
|
||||
{{- end -}}{{- end -}}
|
||||
<img
|
||||
src="{{ $av.RelPermalink }}"
|
||||
alt="{{ $authorPage.Params.name | default $authorPage.Title }}"
|
||||
class="w-5 h-5 object-cover border border-smoke flex-shrink-0"
|
||||
width="{{ $av.Width }}"
|
||||
height="{{ $av.Height }}"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
/>
|
||||
{{- else -}}
|
||||
{{- with .Params.avatar -}}
|
||||
<img
|
||||
src="{{ . }}"
|
||||
alt="{{ $authorPage.Params.name | default $authorPage.Title }}"
|
||||
class="w-5 h-5 object-cover border border-smoke flex-shrink-0"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
/>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
<span class="label text-fog">{{ .Params.name | default .Title }}</span>
|
||||
<span class="text-smoke" aria-hidden="true">/</span>
|
||||
{{- end -}}
|
||||
@@ -54,6 +75,5 @@
|
||||
{{- $post.Date.Format "Jan 2006" -}}
|
||||
</time>
|
||||
</div>
|
||||
|
||||
</a>
|
||||
</article>
|
||||
|
||||
Reference in New Issue
Block a user