Commit Graph

5 Commits

Author SHA1 Message Date
Kazuhiro MUSASHI cff8ef00c5 Distribute `mermaid.js` for the contents pages. 2020-05-01 20:26:30 +09:00
Kazuhiro MUSASHI da156b535f Introduce the pagination to the Labs's section list page:
```
--- a/layouts/labs/list.html
+++ b/layouts/labs/list.html
@@ -6,14 +6,34 @@
     <div class="article-header light-gray"><h1>{{ .Title }}</h1></div>
     {{.Content}}
     <br>
-    {{ range .Data.Pages }}
+    {{ $paginator := .Paginate (where .Data.Pages  "Type" "labs") }}
+    {{ range $paginator.Pages }}
     <div class="summary">
       <h2><a href="{{ .Permalink }}">{{ .Title }} {{ if .Draft }}:: DRAFT{{end}}</a></h2>
       <div class="meta">
-        {{ .Date.Format "Jan 2, 2006" }}: {{.Description}}
+        {{ .Date.Format "Jan 2, 2006" }} &nbsp;
+        {{ range .Params.categories }}
+          #<a href="/categories/{{ . | urlize }}">{{ . }}</a>&nbsp;
+        {{ end }}
+        {{ range .Params.tags }}
+          #<a href="/tags/{{ . | urlize }}">{{ . }}</a>&nbsp;
+        {{ end }}: {{ .Description }}
       </div>
     </div>
     {{ end }}
   </main>

+<!-- Paginator Section Layout
+–––––––––––––––––––––––––––––––––––––––––––––––––– -->
+<nav>
+  {{ $paginator := .Paginate (where .Data.Pages "Type" "labs") }}
+  {{ if .Paginator.HasPrev }}
+  <a href="{{ .Paginator.Prev.URL }}">Prev</a>
+  {{ end }}
+  <span class="">Page {{ .Paginator.PageNumber }} of {{ .Paginator.TotalPages }}</span>
+  {{ if .Paginator.HasNext }}
+  <a href="{{ .Paginator.Next.URL }}">Next</a>
+  {{ end }}
+</nav>
+
 {{ partial "footer.html" . }}
```
2019-04-15 00:02:06 +08:00
Kazuhiro MUSASHI 746c5079d0 Change the Labs section's pagination to be within the section:
```
--- a/layouts/labs/single.html
+++ b/layouts/labs/single.html
@@ -21,11 +21,11 @@
   </main>

   <nav class="pagination">
-    {{ if .Next }}
-      <span class="previous">&larr; <a href="{{ .Next.Permalink }}" rel="prev">{{ .Next.Title }}</a></span>
+    {{ with .PrevInSection }}
+    <span class="previous">&larr; <a href="{{ .Permalink }}" rel="prev">{{ .Title }}</a></span>
     {{ end }}
-    {{ if .Prev }}
-      <span class="next"><a href="{{ .Prev.Permalink }}" rel="next">{{ .Prev.Title }}</a> &rarr;</span>
+    {{ with .NextInSection }}
+    <span class="next"><a href="{{ .Permalink }}" rel="next">{{ .Title }}</a> &rarr;</span>
     {{ end }}
   </nav>
```
2019-04-14 18:56:42 +08:00
Kazuhiro MUSASHI ebdf0b1dfb Load the different headers from the default one. 2019-04-09 08:32:03 +08:00
Kazuhiro MUSASHI 45c958bcdd Display the Labs page explanation, list up the articles on the Labs page. 2019-04-09 08:32:03 +08:00