Hugo site scaffold with blog and hardware pages, layouts, styles, fonts, and image assets.
26 lines
1.1 KiB
HTML
26 lines
1.1 KiB
HTML
{{ define "main" }}
|
|
{{/* the live cover photo is a 3000x1500 JPEG served by pd.w.org; serve a
|
|
resized WebP from assets instead. Position matches the live 42% 43%. */}}
|
|
{{ $hero := resources.Get "img/blog-hero.jpg" }}
|
|
{{ with $hero }}
|
|
{{ $sm := .Resize "800x q80 webp" }}
|
|
{{ $md := .Resize "1600x q80 webp" }}
|
|
<div class="hero hero--photo" style="--hero-sm:url('{{ $sm.RelPermalink }}');--hero-lg:url('{{ $md.RelPermalink }}')">
|
|
<p class="hero__title">Blog</p>
|
|
</div>
|
|
{{ end }}
|
|
|
|
<div class="posts">
|
|
{{ range where site.RegularPages "Section" "posts" }}
|
|
{{ $post := . }}
|
|
<article class="post">
|
|
<time class="post__date" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "January 2, 2006" }}</time>
|
|
<h2 class="post__title"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
|
|
{{ with .Params.thumb }}{{ partial "image.html" (dict "path" . "max" 800 "class" "post__thumb" "alt" ($post.Params.featuredAlt | default $post.Title) "loading" "lazy") }}{{ end }}
|
|
{{ with .Params.excerpt }}<p class="post__excerpt">{{ . }}</p>{{ end }}
|
|
<a class="post__more" href="{{ .RelPermalink }}">Read more…</a>
|
|
</article>
|
|
{{ end }}
|
|
</div>
|
|
{{ end }}
|