Start working on series pages

This commit is contained in:
Danila Fedorin 2023-01-31 17:43:05 -08:00
parent e7cada3764
commit 115057d837
5 changed files with 65 additions and 0 deletions

View File

@ -318,3 +318,25 @@ figure {
} }
} }
} }
.series-status {
display: inline-block;
padding: 0.5rem;
border-radius: 1rem;
border: $standard-border-width solid rgba(black, 0.3);
&.suspended {
background-color: lighten(yellow, 30%);
color: darken(yellow, 30%);
}
&.complete {
background-color: lighten(green, 50%);
color: darken(green, 10%);
}
&.ongoing {
background-color: lighten(lightblue, 10%);
color: darken(lightblue, 60%);
}
}

View File

@ -56,3 +56,18 @@
[searchRequiresJS] [searchRequiresJS]
other = "Search (requires JavaScript)" other = "Search (requires JavaScript)"
[postsFromTo]
other = "First post in {{ .from }}, last post in {{ .to }}"
[seriesStatus]
other = "Series status:"
[suspendedSeries]
other = "Suspended"
[completeSeries]
other = "Complete"
[ongoingSeries]
other = "Ongoing"

View File

@ -0,0 +1 @@
<span class="series-status {{ . }}">{{ i18n "seriesStatus" }} {{ i18n (printf "%sSeries" .) }}</span>

17
layouts/series/list.html Normal file
View File

@ -0,0 +1,17 @@
{{ define "main" }}
<h2>{{ .Title }}</h2>
{{ $pages := .Pages.ByDate }}
{{ $startYear := (index (last 1 .Pages) 0).Date.Format "2006" }}
{{ $endYear := (index (first 1 .Pages) 0).Date.Format "2006" }}
<div class="post-subscript">
<p>{{ partial "seriesstatus.html" .Params.status }}</p>
<p>{{ i18n "postsFromTo" (dict "from" $startYear "to" $endYear) }}</p>
</div>
<p>{{ .Summary }}</p>
<ul class="post-list">
{{ range $pages }}
{{ partial "post.html" . }}
{{ end }}
</ul>
{{ end }}

10
layouts/series/terms.html Normal file
View File

@ -0,0 +1,10 @@
{{ define "main" }}
<h2>{{ .Title }}</h2>
{{ .Content }}
<ul>
{{ range sort .Pages "Title" }}
<li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
{{ end }}