From dcd66864b348fd63f07bc2f3905ba4402de94166 Mon Sep 17 00:00:00 2001
From: Alexander Bilz <mail@alexbilz.com>
Date: Fri, 15 May 2020 13:33:53 +0000
Subject: [PATCH] Added Pagination Support 📖

---
 layouts/index.html   |   42 +++++++++++++++++++++++++-----------------
 static/css/style.css |    3 ++-
 README.md            |    1 +
 3 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/README.md b/README.md
index 991b860..afb3c06 100644
--- a/README.md
+++ b/README.md
@@ -10,6 +10,7 @@
 Features include:
 - Profile picture and slogan
 - Navigation items
+- Pagination
 - Google Analytics (optional)
 - Comments powered by Disqus (optional)
 - Katex support (optional)
diff --git a/layouts/index.html b/layouts/index.html
index 94ca96b..75ee6e1 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,20 +1,28 @@
 {{ define "main" }}
-
-<div class="about animated fadeInDown">
-    {{ range first 10 .Site.RegularPages }}
-        {{ if eq .Type "post"}}
-        <div>
-            <h3><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
-            {{ .Summary }}
-          </div>
-          {{ if .Truncated }}
-          <!-- This <div> includes a read more link, but only if the summary is truncated... -->
-          <div>
-            <a href="{{ .RelPermalink }}">Read More…</a>
-          </div>
-          {{ end }}
-        {{ end }}
-    {{ end }}
+  {{ $paginator := .Paginate (where .Pages "Type" "post") }}
+  {{ range $paginator.Pages }}
+  <div class="post animated fadeInDown">
+    <div class="post-title">
+      <h3><a href="{{ .RelPermalink }}">{{ .Title }}</a>
+      </h3>
+    </div>
+    <div class="post-content"><div class="p_part"><p>{{ .Summary }}</p></div>
+  
+  <div class="p_part"><p></p></div></div>
+    <div class="post-footer">
+      <div class="meta">
+        <div class="info"><i class="fa fa-sun-o"></i><span class="date">{{ .Date.Format "Mon, Jan 2, 2006" }}</span>
+          {{ with .Params.tags }}
+          {{- range $index, $el := . -}}
+          <a class="tag" href="{{ ( printf "tags/%s/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
+          {{- end -}}
+          {{ end }}       
+        </div>
+      </div>
+    </div>
+  </div>
+  {{ end }}
+<div class="pagination">
+  {{ template "_internal/pagination.html" . }}
 </div>
-
 {{ end }}
\ No newline at end of file
diff --git a/static/css/style.css b/static/css/style.css
index 00e1dcb..a28c50a 100644
--- a/static/css/style.css
+++ b/static/css/style.css
@@ -377,7 +377,7 @@
 .pagination {
   margin: 30px;
   padding: 0px 0 56px 0;
-  border-bottom: 1px solid #f2f2f2;
+  text-align: center;
 }
 .pagination ul {
   list-style: none;
@@ -392,6 +392,7 @@
 }
 .pagination ul li a {
   text-decoration: none;
+  color: rgba(0, 0, 0, 0.5);
 }
 .pagination .pre {
   float: left;

--
Gitblit v1.10.0