Move article.page wrapping to summary.html instead of at list template

I am trying to make various templates and partials act more like
self-contained components.

This is in preparation for #113.
This commit is contained in:
2025-09-01 00:43:18 -05:00
parent 37dbdc53af
commit 6251b033d5
5 changed files with 52 additions and 52 deletions

View File

@@ -1,9 +1,7 @@
<div class="page-list"> <div class="page-list">
{{ with . }} {{ with . }}
{{ range . }} {{ range . }}
<article class="page"> {{ .Render "summary" }}
{{ .Render "summary" }}
</article>
{{ end }} {{ end }}
{{ else }} {{ else }}
<div> <div>

View File

@@ -1,16 +1,18 @@
<h2 class="page-title"> <article class="page">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> <h2 class="page-title">
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }} <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</h2> {{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
{{ partial "page-metadata/author.html" . }} {{ partial "page-metadata/author.html" . }}
{{ with .Summary }} {{ with .Summary }}
<div class="page-description"> <div class="page-description">
{{ . }} {{ . }}
</div>
{{ end }}
<div class="readmore">
<a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a>
</div> </div>
{{ end }} </article>
<div class="readmore">
<a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a>
</div>

View File

@@ -11,9 +11,7 @@
<div class="page-list"> <div class="page-list">
{{ with .Paginator.Pages }} {{ with .Paginator.Pages }}
{{ range . }} {{ range . }}
<article class="page"> {{ .Render "summary" }}
{{ .Render "summary" }}
</article>
{{ end }} {{ end }}
{{ else }} {{ else }}
<div> <div>

View File

@@ -1,21 +1,21 @@
<h2 class="page-title"> <article class="page">
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }} <h2 class="page-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> {{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }} <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</h2> {{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
{{ partial "page-metadata/series.html" . }} {{ partial "page-metadata/series.html" . }}
{{ with .Summary }} {{ with .Summary }}
<div class="page-description"> <div class="page-description">
{{ . }} {{ . }}
</div> </div>
{{ end }}
<div class="page-list series-inner">
{{ range .Data.Pages.Reverse }}
<article class="page">
{{ .Render "summary" }}
</article>
{{ end }} {{ end }}
</div>
<div class="page-list series-inner">
{{ range .Data.Pages.Reverse }}
{{ .Render "summary" }}
{{ end }}
</div>
</article>

View File

@@ -1,19 +1,21 @@
<h2 class="page-title"> <article class="page">
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }} <h2 class="page-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> {{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }} <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</h2> {{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
{{ partial "page-metadata/post-short.html" . }} {{ partial "page-metadata/post-short.html" . }}
{{ partial "feature-figure.html" . }} {{ partial "feature-figure.html" . }}
{{ with .Summary }} {{ with .Summary }}
<div class="page-description"> <div class="page-description">
{{ . }} {{ . }}
</div>
{{ end }}
<div class="readmore">
<a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a>
</div> </div>
{{ end }} </article>
<div class="readmore">
<a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a>
</div>