add prev/next post links
This commit is contained in:
parent
099436ed87
commit
ab85b06c84
61
layouts/posts/single.html
Normal file
61
layouts/posts/single.html
Normal file
|
@ -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 }}
|
Loading…
Reference in a new issue