summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2019-04-15 19:14:59 +0200
committerChristoph Cullmann <cullmann@kde.org>2019-04-15 19:14:59 +0200
commitab85b06c84fc1462a68c55d9c182beb0a236b130 (patch)
tree71ecdde1972c043ca64b269962fdc2353b18b0cf /layouts
parent099436ed870acbc18e86624eeaf68d93fe8a44e0 (diff)
add prev/next post links
Diffstat (limited to 'layouts')
-rw-r--r--layouts/posts/single.html61
1 files changed, 61 insertions, 0 deletions
diff --git a/layouts/posts/single.html b/layouts/posts/single.html
new file mode 100644
index 0000000..c9e4926
--- /dev/null
+++ b/layouts/posts/single.html
@@ -0,0 +1,61 @@
+{{ define "title" }}
+ {{ .Title }} ยท {{ .Site.Title }}
+{{ end }}
+{{ define "content" }}
+ <section class="container post">
+ <article>
+ <header>
+ <div class="post-title">
+ <h1 class="title">{{ .Title }}</h1>
+ </div>
+ <div class="post-meta">
+ <div class="date">
+ <span class="posted-on">
+ <i class="fas fa-calendar"></i>
+ <time datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'>
+ {{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}
+ </time>
+ </span>
+ <span class="reading-time">
+ <i class="fas fa-clock"></i>
+ {{ i18n "reading_time" .ReadingTime }}
+ </span>
+ </div>
+ </div>
+ </header>
+
+ <div>
+ {{ .Content }}
+
+ <!-- meta data at footer of content -->
+ {{ with .Page.Params.Categories }}{{ partial "taxonomy/categories" . }}{{ end }}
+ {{ with .Page.Params.Tags }}{{ partial "taxonomy/tags" . }}{{ end }}
+ </div>
+
+ <footer>
+
+<!-- Next Post/ Previous Post Links -->
+{{ if .NextInSection }}
+ <div style="float: left; text-align: right;">Next Post</div>
+{{ end }}
+{{ if .PrevInSection }}
+ <div style="float: right; text-align: right;">Previous Post</div>
+{{ end }}
+
+<br>
+
+{{ with .NextInSection }}
+ <a href="{{ .Permalink }}" style="text-align: left; float: left; max-width: 40%;">{{ .Title }}</a>
+{{ end }}
+{{ with .PrevInSection }}
+ <a href="{{ .Permalink }}" style="text-align: right; float: right; max-width: 40%">{{ .Title }}</a>
+{{ end }}
+
+ {{ partial "posts/series" . }}
+ {{ partial "posts/disqus" . }}
+ </footer>
+ </article>
+
+ {{ partial "posts/math" . }}
+ </section>
+{{ end }}