repos / starfx

supercharged async flow control library.
git clone https://github.com/neurosnap/starfx.git

commit
5730a71
parent
ff33933
author
Eric Bower
date
2024-06-21 17:22:45 +0000 UTC
refactor: pager partial
2 files changed,  +24, -21
A docs/tmpl/pager.partial.tmpl
+23, -0
 1@@ -0,0 +1,23 @@
 2+{{ define "pager" }}
 3+<div class="flex justify-between gap-2 my-4">
 4+    <div class="pager max-w-half flex items-center">
 5+      {{if .Prev}}
 6+      <div class="flex flex-col items-start">
 7+        <div class="text-sm font-grey-light">&lt;&lt; PREV</div>
 8+        <a href="{{.Prev.GenHref}}" class="text-xl link-alt-adj">{{.Prev.Text}}</a>
 9+      </div>
10+      {{end}}
11+    </div>
12+
13+    <div class="pager max-w-half flex items-center justify-end">
14+      {{if .Next}}
15+      <div class="flex flex-col items-end">
16+        <div class="text-sm font-grey-light">
17+          NEXT &gt;&gt;
18+        </div>
19+        <a href="{{.Next.GenHref}}" class="text-xl align-right link-alt-adj">{{.Next.Text}}</a>
20+      </div>
21+      {{end}}
22+    </div>
23+</div>
24+{{end}}
M docs/tmpl/post.page.tmpl
+1, -21
 1@@ -22,27 +22,7 @@
 2       {{.Data.Html}}
 3     </article>
 4 
 5-    <div class="flex justify-between gap-2 my-4">
 6-      {{if .Prev}}
 7-        <div class="pager max-w-half flex items-center">
 8-          <div class="flex flex-col items-start">
 9-            <div class="text-sm font-grey-light">&lt;&lt; PREV</div>
10-            <a href="{{.Prev.GenHref}}" class="text-xl link-alt-adj">{{.Prev.Text}}</a>
11-          </div>
12-        </div>
13-      {{end}}
14-
15-      {{if .Next}}
16-        <div class="pager max-w-half flex items-center justify-end">
17-          <div class="flex flex-col items-end">
18-            <div class="text-sm font-grey-light">
19-              NEXT &gt;&gt;
20-            </div>
21-            <a href="{{.Next.GenHref}}" class="text-xl align-right link-alt-adj">{{.Next.Text}}</a>
22-          </div>
23-        </div>
24-      {{end}}
25-    </div>
26+    {{template "pager" .}}
27   </main>
28 
29   {{template "sitemap-footer" .}}