Add the series to the content header

This commit is contained in:
Eryn Wells 2022-10-31 08:41:24 -07:00
parent ecb39a9298
commit 76e3da0de1
4 changed files with 40 additions and 19 deletions

View file

@ -0,0 +1,18 @@
<header>
{{ partial "development/draft_tag.html" . }}
<div class="post-title">
<h1>{{ .Title }}</h1>
{{ if not (eq .Type "page") }}
<div class="post-date"><time>{{ .Date | time.Format "January 2, 2006" }}</time></div>
{{ end }}
</div>
{{- if .Params.series -}}
{{- $series := .GetTerms "series" -}}
{{- if gt (len $series) 1 -}}
{{- errorf "More than one series for %s" .Permalink -}}
{{- end -}}
{{- with index $series 0 -}}
<span class="series"><a href="{{ .Permalink }}">{{ .Title }}</a></span>
{{- end -}}
{{- end -}}
</header>

View file

@ -1,12 +1,4 @@
<header> {{ partial "content_header.html" . }}
{{ partial "development/draft_tag.html" . }}
<div class="post-title">
<h1>{{ .Title }}</h1>
{{ if not (eq .Type "page") }}
<div class="post-date"><time>{{ .Date | time.Format "January 2, 2006" }}</time></div>
{{ end }}
</div>
</header>
<section class="post-content"> <section class="post-content">
{{ .Content }} {{ .Content }}

View file

@ -5,15 +5,9 @@
{{ define "main" }} {{ define "main" }}
<nav><a class="back" href="{{ ref . `photos` }}">Back</a></nav> <nav><a class="back" href="{{ ref . `photos` }}">Back</a></nav>
{{ if .Title }} {{- if .Title -}}
<header> {{ partial "content_header.html" . }}
{{ partial "development/draft_tag.html" . }} {{- end -}}
<div class="post-title">
<h1 {{ with .Params.langs.title }}lang="{{ . }}"{{ end }}>{{ .Title }}</h1>
<div class="post-date"><time>{{ .Date | time.Format "January 2, 2006" }}</time></div>
</div>
</header>
{{ end }}
{{ $photos := .Resources.ByType "image" }} {{ $photos := .Resources.ByType "image" }}
{{ if eq (len $photos) 0 }} {{ if eq (len $photos) 0 }}

View file

@ -40,6 +40,7 @@
--body-code-background-color: rgb(var(--super-lt-gray)); --body-code-background-color: rgb(var(--super-lt-gray));
--heading-color: rgb(var(--black)); --heading-color: rgb(var(--black));
--header-series-arrow-foreground-color: rgb(var(--sub-dk-gray));
--html-background-color: rgb(var(--white)); --html-background-color: rgb(var(--white));
--html-color: rgba(var(--black), 0.8); --html-color: rgba(var(--black), 0.8);
@ -71,6 +72,7 @@
--body-code-background-color: rgb(var(--dk-gray)); --body-code-background-color: rgb(var(--dk-gray));
--heading-color: rgb(var(--white)); --heading-color: rgb(var(--white));
--header-series-arrow-foreground-color: rgb(var(--super-dk-gray));
--html-background-color: rgb(var(--black)); --html-background-color: rgb(var(--black));
--html-color: rgba(var(--white), 0.8); --html-color: rgba(var(--white), 0.8);
@ -345,6 +347,10 @@ main {
width: 100%; width: 100%;
} }
main > header {
margin-bottom: var(--body-item-spacing);
}
main > :first-child { margin-block-start: 0; } main > :first-child { margin-block-start: 0; }
main > :last-child { margin-block-end: 0; } main > :last-child { margin-block-end: 0; }
@ -394,6 +400,18 @@ ol ol {
margin-inline-start: var(--body-item-spacing); margin-inline-start: var(--body-item-spacing);
} }
header > span.series {
font-size: 1.75rem;
letter-spacing: 1px;
margin-inline-start: 0.5em;
}
header > span.series::before {
color: var(--header-series-arrow-foreground-color);
content: "↳";
margin-inline-end: 0.25em;
}
.post-list { .post-list {
list-style: none; list-style: none;
margin: 0; margin: 0;
@ -423,7 +441,6 @@ ol ol {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 0 4rem; gap: 0 4rem;
margin-bottom: var(--body-item-spacing);
} }
.post-title h1 { .post-title h1 {