Commit Graph

19 Commits

Author SHA1 Message Date
Kazuhiro MUSASHI a90131917f Modify the files under `layouts/` to follow the convention. 2020-05-01 19:27:27 +09:00
Kazuhiro MUSASHI 5ec3b74ae9 Change base url based on the environment:
```
--- a/layouts/partials/sections-definition.html
+++ b/layouts/partials/sections-definition.html
@@ -1,3 +1,3 @@
-          <li><a href="https://blog.kazu634.com/labs/">Labs</a></li>
-          <li><a href="https://blog.kazu634.com/quotes/">Quotes</a></li>
-          <li><a href="https://blog.kazu634.com/travel/">Travel</a></li>
+          <li><a href="{{ .Site.BaseURL }}/labs/">Labs</a></li>
+          <li><a href="{{ .Site.BaseURL }}/quotes/">Quotes</a></li>
+          <li><a href="{{ .Site.BaseURL }}/travel/">Travel</a></li>
```
2019-05-04 21:42:30 +08:00
Kazuhiro MUSASHI 80eb317187 List up the post category article only within post list page.
This is to change the post list page behaviour to list up the articles
belonging to the post category,  not all the posts regardless of the
categories.
2019-04-16 16:10:58 +08: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 306627f732 Add the travel section to the section definition.
```
--- a/layouts/partials/sections-definition.html
+++ b/layouts/partials/sections-definition.html
@@ -1,2 +1,3 @@
           <li><a href="https://blog.kazu634.com/labs/">Labs</a></li>
           <li><a href="https://blog.kazu634.com/quotes/">Quotes</a></li>
+          <li><a href="https://blog.kazu634.com/travel/">Travel</a></li>
```
2019-04-14 16:50:23 +08:00
Kazuhiro MUSASHI 0982980ea5 Display the travel section explanation. 2019-04-14 16:49:56 +08:00
Kazuhiro MUSASHI 545c096087 Modify the header templates to refer to the section partial html. 2019-04-14 16:02:03 +08:00
Kazuhiro MUSASHI 0984e402a4 Add the partial definition for the section definition. 2019-04-14 16:01:23 +08:00
Kazuhiro MUSASHI e44c14657a Customize the pagination to be within the Quotes section. 2019-04-14 15:28:20 +08:00
Kazuhiro MUSASHI 8bbe6b7223 Add the explanation for the Quotes section. 2019-04-14 15:28:09 +08:00
Kazuhiro MUSASHI f91dd9b965 Add Quotes section for each header files. 2019-04-14 15:28:00 +08:00
Kazuhiro MUSASHI c1cc2467e7 Add a shorcode for TopoJSON support. 2019-04-14 00:29:54 +08:00
Kazuhiro MUSASHI 7e1fc240f3 Add `leaflet-circle.html` as a shorcode for map circle. 2019-04-14 00:29:26 +08:00
Kazuhiro MUSASHI 78fd1b8673 Add `leaflet-marker.html` as a shortcode for map marker. 2019-04-14 00:28:58 +08:00
Kazuhiro MUSASHI 9cffb5d267 Add `leaflet-map.html` as a short code for the map. 2019-04-14 00:28:23 +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
Kazuhiro MUSASHI 057b117413 Add link to the Labs section 2019-04-09 07:26:35 +08:00