Commit ee90d9d2 authored by Jamie Tanna's avatar Jamie Tanna

Split `single` layout for blog posts / non-blog posts

Instead of overpopulating `_default/single` with some custom stuff for
blog posts, and some for regular pages, we should instead have two
separate layouts.
parent b591f44e
{{ define "main" }}
<main>
<a name="top"></a>
<div class="post">
{{ partial "single/post-info.html" . }}
{{ partial "single/title.html" . }}
{{ partial "single/table-of-contents.html" . }}
{{ partial "single/header.html" . }}
......@@ -14,51 +12,6 @@
{{ partial "single/footer.html" . }}
</div>
<div class="post-details">
<p>Written by <strong>{{ .Site.Params.author }}</strong> on <strong>{{ dateFormat "02 January 2006" .PublishDate }}</strong>
{{- if .GitInfo -}}
{{- if .GitInfo.AuthorDate -}}
{{- if ne .PublishDate .GitInfo.AuthorDate -}}
, and last updated on <strong><a href="https://gitlab.com/jamietanna/jvt.me/commit/{{ .GitInfo.Hash }}">{{ dateFormat "02 January 2006" .GitInfo.AuthorDate }}</a></strong>
{{- end -}}.
{{- end -}}
{{- end -}}
</p>
{{- if eq .Type "posts" -}}
{{ $licenseCode := index $.Site.Data.licenses .Params.License_Code }}
{{ $licenseProse := index $.Site.Data.licenses .Params.License_Prose }}
<p>Content for this article is shared under the terms of the <a href="{{ index $licenseProse.seeAlso 0 }}">{{ $licenseProse.name }}</a>, and code is shared under the <a href="{{ index $licenseCode.seeAlso 0 }}">{{ $licenseCode.name }}</a>.
</p>
<p>Categories:</p>
<ul>
{{ range .Params.Categories }}
<li> <a href="/posts/categories/{{ . }}">{{ . }}</a></li>
{{ end }}
</ul>
<p>Tags:</p>
<ul>
{{ range .Params.Tags }}
<li> <a href="/posts/tags/{{ . }}">{{ . }}</a></li>
{{ end }}
</ul>
{{ $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related }}
<p>Other posts you may be interested in:</p>
<ul>
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a></li>
{{ end }}
</ul>
{{ end }}
{{- end -}}
{{ partial "webmention.html" . }}
</div>
<div class="pagination">
{{- if .PrevPage }}
<a href="{{ .PrevPage.URL }}" class="left arrow">&#8592;</a>
......@@ -67,7 +20,7 @@
<a href="{{ .NextPage.URL }}" class="right arrow">&#8594;</a>
{{- end }}
<a href="#top" class="top">Top</a>
<a href="#" class="top">Top</a>
</div>
</main>
......
{{ define "main" }}
<main>
<a name="top"></a>
<div class="post">
{{ partial "single/post-info.html" . }}
{{ partial "single/title.html" . }}
{{ partial "single/table-of-contents.html" . }}
{{ partial "single/header.html" . }}
{{ .Content }}
{{ partial "single/footer.html" . }}
</div>
<div class="post-details">
<p>Written by <strong>{{ .Site.Params.author }}</strong> on <strong>{{ dateFormat "02 January 2006" .PublishDate }}</strong>
{{- if .GitInfo -}}
{{- if .GitInfo.AuthorDate -}}
{{- if ne .PublishDate .GitInfo.AuthorDate -}}
, and last updated on <strong><a href="https://gitlab.com/jamietanna/jvt.me/commit/{{ .GitInfo.Hash }}">{{ dateFormat "02 January 2006" .GitInfo.AuthorDate }}</a></strong>
{{- end -}}.
{{- end -}}
{{- end -}}
</p>
{{ $licenseCode := index $.Site.Data.licenses .Params.License_Code }}
{{ $licenseProse := index $.Site.Data.licenses .Params.License_Prose }}
<p>Content for this article is shared under the terms of the <a href="{{ index $licenseProse.seeAlso 0 }}">{{ $licenseProse.name }}</a>, and code is shared under the <a href="{{ index $licenseCode.seeAlso 0 }}">{{ $licenseCode.name }}</a>.
</p>
<p>Categories:</p>
<ul>
{{ range .Params.Categories }}
<li> <a href="/posts/categories/{{ . }}">{{ . }}</a></li>
{{ end }}
</ul>
<p>Tags:</p>
<ul>
{{ range .Params.Tags }}
<li> <a href="/posts/tags/{{ . }}">{{ . }}</a></li>
{{ end }}
</ul>
{{ $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related }}
<p>Other posts you may be interested in:</p>
<ul>
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a></li>
{{ end }}
</ul>
{{ end }}
{{ partial "webmention.html" . }}
</div>
<div class="pagination">
{{- if .PrevPage }}
<a href="{{ .PrevPage.URL }}" class="left arrow">&#8592;</a>
{{- end }}
{{- if .NextPage }}
<a href="{{ .NextPage.URL }}" class="right arrow">&#8594;</a>
{{- end }}
<a href="#top" class="top">Top</a>
</div>
</main>
{{ end }}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment