diff options
author | Jeremy Bise <jeremy.bise@thosegeeks.com> | 2019-04-16 15:51:41 +0300 |
---|---|---|
committer | Jeremy Bise <jeremy.bise@thosegeeks.com> | 2019-04-16 15:51:41 +0300 |
commit | 71c2b902a37af77c92d254adb866f212e0908113 (patch) | |
tree | e4d6ce258c68aedd9ca540acbb6d7fee7fdea589 | |
parent | 1a8963e81ac01fbc9e0b5782f2b9f74a4d4f5ec1 (diff) |
post single gets its own template, added prev/next pagination
-rw-r--r-- | layouts/_default/single.html | 3 | ||||
-rw-r--r-- | layouts/posts/single.html | 59 |
2 files changed, 61 insertions, 1 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 7a7164c..b6cc0f2 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -24,6 +24,7 @@ <div class="entry-content"> {{ .Content }} </div> - <div class="entry-footer"></div> + <div class="entry-footer"> + </div> </article> {{ end }}
\ No newline at end of file diff --git a/layouts/posts/single.html b/layouts/posts/single.html new file mode 100644 index 0000000..37ad279 --- /dev/null +++ b/layouts/posts/single.html @@ -0,0 +1,59 @@ +{{ define "entry_header" }} + {{ if .Params.image }} + <div class="site-featured-image"> + <figure class="post-thumbnail"> + <img src="{{ .Params.image }}" /> + </figure> + <div class="entry-header"> + <h1 class="entry-title">{{ .Title }}</h1> + <div class="entry-meta"> + {{ partial "entry-meta" . }} + </div> + </div> + </div> + {{ end }} +{{ end }} + +{{ define "main" }} + <article class="post entry"> + {{ if (not (isset .Params "image")) }} + <header class="entry-header"> + <h1 class="entry-title">{{ .Title }}</h1> + <div class="entry-meta"> + {{ partial "entry-meta" . }} + </div> + </header> + {{ end }} + <div class="entry-content"> + {{ .Content }} + </div> + <div class="entry-footer"> + {{ partial "entry-meta" . }} + </div> + </article> + <nav class="navigation post-navigation" role="navigation"> + <h2 class="screen-reader-text">Post navigation</h2> + <div class="nav-links"> + {{ if .PrevInSection }} + <div class="nav-previous"> + <a href="{{.PrevInSection.Permalink}}" rel="prev"> + <span class="meta-nav" aria-hidden="true">Previous post</span> + <span class="screen-reader-text">Previous post:</span> + <br> + <span class="post-title">{{.PrevInSection.Title}}</span> + </a> + </div> + {{ end }} + {{ if .NextInSection }} + <div class="nav-next"> + <a href="{{.PrevInSection.Permalink}}" rel="next"> + <span class="meta-nav" aria-hidden="true">Next post</span> + <span class="screen-reader-text">Next post:</span> + <br> + <span class="post-title">{{.NextInSection.Title}}</span> + </a> + </div> + {{ end }} + </div> + </nav> +{{ end }}
\ No newline at end of file |