Cleanup posts rendering

This commit is contained in:
Alex Shpak
2018-11-25 11:59:42 +01:00
parent a9738191b8
commit aa2b1870d0
5 changed files with 11 additions and 17 deletions
+2 -4
View File
@@ -8,10 +8,8 @@
</head>
<body>
<main>
<div class="book-posts mx-auto">
{{ template "main" . }}
</div>
<main class="book-posts mx-auto">
{{ template "main" . }}
</main>
{{ partial "docs/inject/body" . }}
-2
View File
@@ -1,5 +1,4 @@
{{ define "main" }}
<section>
{{ $paginator := .Paginate (where .Pages "Params.hidden" "ne" true) }}
{{ range sort .Paginator.Pages }}
<article>
@@ -16,5 +15,4 @@
</article>
{{ end }}
{{ template "_internal/pagination.html" . }}
</section>
{{ end }}
+7 -9
View File
@@ -1,11 +1,9 @@
{{ define "main" }}
<section>
<header>
<h1>{{ .Title }}</h1>
<h5>{{ .Date.Format "January 2, 2006" }}</h5>
</header>
<article class="markdown">
{{- .Content -}}
</article>
</section>
<header>
<h1>{{ .Title }}</h1>
<h5>{{ .Date.Format "January 2, 2006" }}</h5>
</header>
<article class="markdown">
{{- .Content -}}
</article>
{{ end }}