Add the series to the content header
This commit is contained in:
parent
ecb39a9298
commit
76e3da0de1
4 changed files with 40 additions and 19 deletions
18
layouts/partials/content_header.html
Normal file
18
layouts/partials/content_header.html
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue