Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-08-08 10:19:49 +02:00
parent 7ef9274268
commit ccabcf9d5b
10 changed files with 119 additions and 21 deletions

View File

@@ -0,0 +1,8 @@
{{ define "main" }}
<main>
{{ partial (printf "posts/%s.html" (.Params.heroType | default "hero")) . }}
<div class="content">
{{ .Content }}
</div>
</main>
{{ end }}

View File

@@ -0,0 +1,12 @@
{{- $path := .path -}}
{{- $alt := .alt -}}
{{- $caption := .caption -}}
{{ if $path }}
<figure class="image">
<img src="{{- $path | absURL -}}" {{ with $alt }}alt="{{- . -}}"{{ end }} />
{{ with $caption }}
<figcaption>{{ . }}</figcaption>
{{ end }}
</figure>
{{ end }}

View File

@@ -0,0 +1,16 @@
<section class="hero">
<h1>{{ .Title }}</h1>
<div class="meta">
<span class="date">{{ .Date | time.Format ":date_medium" }}</span>
&middot;
<span class="duration">{{ printf "%d MIN READ" .ReadingTime }}</span>
</div>
{{ with .Params.heroImage }}
{{ partial "image.html" (dict
"path" .path
"alt" .alt
"caption" .caption
)
}}
{{ end }}
</section>