Add the series to the content header

This commit is contained in:
Eryn Wells 2022-10-31 08:41:24 -07:00
parent c74741f5c5
commit f1d5b2ef58
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 "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>
{{ partial "content_header.html" . }}
<section class="post-content">
{{ .Content }}

View file

@ -5,15 +5,9 @@
{{ define "main" }}
<nav><a class="back" href="{{ ref . `photos` }}">Back</a></nav>
{{ if .Title }}
<header>
{{ partial "development/draft_tag.html" . }}
<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 }}
{{- if .Title -}}
{{ partial "content_header.html" . }}
{{- end -}}
{{ $photos := .Resources.ByType "image" }}
{{ if eq (len $photos) 0 }}