From fd3ec89897b1c3871b6761083611c2c3f158fd69 Mon Sep 17 00:00:00 2001
From: Khosrow Moossavi <khos2ow@gmail.com>
Date: Sat, 27 Oct 2018 12:43:26 +0000
Subject: [PATCH] Taxonomy initial commit, tags and categories (#90)

---
 resources/_gen/assets/scss/scss/coder.scss_5e1eb8e37c42cdfb6215b61e44dcfa5f.json    |    2 
 layouts/_default/list.html                                                          |    7 +++
 layouts/posts/single.html                                                           |   24 +++++++-----
 layouts/partials/taxonomy/tags.html                                                 |    9 ++++
 assets/scss/_content_rtl.scss                                                       |    8 ++++
 layouts/partials/list.html                                                          |    9 ++++
 resources/_gen/assets/scss/scss/coder.scss_5e1eb8e37c42cdfb6215b61e44dcfa5f.content |    2 
 assets/scss/_content.scss                                                           |   27 +++++++------
 layouts/partials/taxonomy/categories.html                                           |    9 ++++
 9 files changed, 70 insertions(+), 27 deletions(-)

diff --git a/assets/scss/_content.scss b/assets/scss/_content.scss
index cb4e8e4..88c7c45 100644
--- a/assets/scss/_content.scss
+++ b/assets/scss/_content.scss
@@ -6,16 +6,13 @@
     header {
       margin-top: 6.4rem;
       margin-bottom: 3.2rem;
-      h1, h2 {
+      h1 {
+        font-size: 4.2rem;
+        line-height: 4.6rem;
         margin: 0;
-      }
-      h2 {
-        font-size: 1.8rem;
-        line-height: 2.2rem;
-        color: $fg-color;
-        margin-top: 1.8rem;
         @media only screen and (max-device-width : 768px) {
-          font-size: 1.6rem;
+          font-size: 4.0rem;
+          line-height: 4.4rem;
         }
       }
     }
@@ -28,13 +25,17 @@
       margin-bottom: .75em;
     }
     .post-meta {
-      .posted-on {
-        display: inline-block;
+      i {
+        text-align: center;
+        width: 1.6rem;
         margin-left: 0;
-        margin-right: 1.5rem;
+        margin-right: 0.5rem;
       }
-      .reading-time {
-        display: inline-block;
+      .date {
+        .posted-on {
+          margin-left: 0;
+          margin-right: 1.5rem;
+        }
       }
     }
   }
diff --git a/assets/scss/_content_rtl.scss b/assets/scss/_content_rtl.scss
index 87c5706..daa6101 100644
--- a/assets/scss/_content_rtl.scss
+++ b/assets/scss/_content_rtl.scss
@@ -7,8 +7,16 @@
           margin-right: 0;
         }
       }
+      .tags,
+      .categories {
+        i {
+          margin-left: 0.5rem;
+          margin-right: 0;
+        }
+      }
     }
   }
+
   .list {
     ul {
       li {
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 0a18678..d62bc46 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -1,5 +1,10 @@
 {{ define "title" }}
-  {{ .Title }} · {{ .Site.Title }}
+  {{- if eq .Kind "taxonomy" -}}
+    {{- .Data.Singular | title -}}
+    {{- print ": " -}}
+  {{- end -}}
+
+  {{- .Title }} · {{ .Site.Title -}}
 {{ end }}
 {{ define "content" }}
   {{ partial "list.html" . }}
diff --git a/layouts/partials/list.html b/layouts/partials/list.html
index f8e67dc..b880669 100644
--- a/layouts/partials/list.html
+++ b/layouts/partials/list.html
@@ -1,5 +1,12 @@
 <section class="container list">
-  <h1 class="title">{{ .Title }}</h1>
+  <h1 class="title">
+    {{- if eq .Kind "taxonomy" -}}
+      {{- .Data.Singular | title -}}
+      {{- print ": " -}}
+    {{- end -}}
+
+    {{- .Title -}}
+  </h1>
   <ul>
     {{ range .Paginator.Pages }}
     <li>
diff --git a/layouts/partials/taxonomy/categories.html b/layouts/partials/taxonomy/categories.html
new file mode 100644
index 0000000..8be7d71
--- /dev/null
+++ b/layouts/partials/taxonomy/categories.html
@@ -0,0 +1,9 @@
+<div class="categories">
+  <i class="fas fa-folder"></i>
+  {{- range $index, $el := . -}}
+    {{- if gt $index 0 }}
+      <span class="separator">•</span>
+    {{- end }}
+    <a href="{{ ( print "categories/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
+  {{- end -}}
+</div>
diff --git a/layouts/partials/taxonomy/tags.html b/layouts/partials/taxonomy/tags.html
new file mode 100644
index 0000000..332fb98
--- /dev/null
+++ b/layouts/partials/taxonomy/tags.html
@@ -0,0 +1,9 @@
+<div class="tags">
+  <i class="fas fa-tag"></i>
+  {{- range $index, $el := . -}}
+    {{- if gt $index 0 }}
+      <span class="separator">•</span>
+    {{- end }}
+    <a href="{{ ( print "tags/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
+  {{- end -}}
+</div>
diff --git a/layouts/posts/single.html b/layouts/posts/single.html
index 373f422..5a72d8c 100644
--- a/layouts/posts/single.html
+++ b/layouts/posts/single.html
@@ -9,16 +9,20 @@
           <h1 class="title">{{ .Title }}</h1>
         </div>
         <div class="post-meta">
-          <span class="posted-on">
-            <i class="far fa-calendar"></i>
-            <time datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'>
-              {{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}
-            </time>
-          </span>
-          <span class="reading-time">
-            <i class="far fa-clock"></i>
-            {{ i18n "readingTime" .ReadingTime }}
-          </span>
+          <div class="date">
+            <span class="posted-on">
+              <i class="fas fa-calendar"></i>
+              <time datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'>
+                {{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}
+              </time>
+            </span>
+            <span class="reading-time">
+              <i class="fas fa-clock"></i>
+              {{ i18n "readingTime" .ReadingTime }}
+            </span>
+          </div>
+          {{ with .Page.Params.Categories }}{{ partial "taxonomy/categories" . }}{{ end }}
+          {{ with .Page.Params.Tags }}{{ partial "taxonomy/tags" . }}{{ end }}
         </div>
       </header>
 
diff --git a/resources/_gen/assets/scss/scss/coder.scss_5e1eb8e37c42cdfb6215b61e44dcfa5f.content b/resources/_gen/assets/scss/scss/coder.scss_5e1eb8e37c42cdfb6215b61e44dcfa5f.content
index 3f56b84..4d8dd6f 100644
--- a/resources/_gen/assets/scss/scss/coder.scss_5e1eb8e37c42cdfb6215b61e44dcfa5f.content
+++ b/resources/_gen/assets/scss/scss/coder.scss_5e1eb8e37c42cdfb6215b61e44dcfa5f.content
@@ -1 +1 @@
-*,*:after,*:before{box-sizing:inherit}html{box-sizing:border-box;font-size:62.5%}body{display:flex;color:#212121;background-color:#fafafa;font-family:Merriweather,Georgia,serif;font-size:1.6em;font-weight:300;line-height:1.8em}@media only screen and (max-device-width:768px){body{font-size:1.6em;line-height:1.6em}}a{font-weight:300;color:#1565c0;text-decoration:none}a:focus,a:hover{text-decoration:underline}p{margin:2rem 0}h1,h2,h3,h4,h5,h6{font-family:Lato,Helvetica,sans-serif;font-weight:700;color:#000;margin:6.4rem 0 3.2rem}h1{font-size:3.2rem;line-height:3.6rem}@media only screen and (max-device-width:768px){h1{font-size:3rem;line-height:3.4rem}}h2{font-size:2.8rem;line-height:3.2rem}@media only screen and (max-device-width:768px){h2{font-size:2.6rem;line-height:3rem}}h3{font-size:2.4rem;line-height:2.8rem}@media only screen and (max-device-width:768px){h3{font-size:2.2rem;line-height:2.6rem}}h4{font-size:2.2rem;line-height:2.6rem}@media only screen and (max-device-width:768px){h4{font-size:2rem;line-height:2.4rem}}h5{font-size:2rem;line-height:2.4rem}@media only screen and (max-device-width:768px){h5{font-size:1.8rem;line-height:2.2rem}}h6{font-size:1.8rem;line-height:2.2rem}@media only screen and (max-device-width:768px){h6{font-size:1.6rem;line-height:2rem}}b,strong{font-weight:700}pre{display:block;font-family:source code pro,lucida console,monospace;font-size:1.6rem;font-weight:400;line-height:2.6rem;margin:2rem 0;padding:2rem;overflow-x:auto}pre code{background-color:inherit;color:inherit}code{font-family:source code pro,lucida console,monospace;font-size:1.6rem;font-weight:400;background-color:#e0e0e0;color:#212121;padding:.2rem .4rem}blockquote{border-left:2px solid #e0e0e0;padding-left:2rem;line-height:2.2rem;font-weight:400;font-style:italic}th,td{padding:1.6rem}table{border-collapse:collapse}table td,table th{border:2px solid #000}table tr:first-child th{border-top:0}table tr:last-child td{border-bottom:0}table tr td:first-child,table tr th:first-child{border-left:0}table tr td:last-child,table tr th:last-child{border-right:0}img{max-width:100%}.wrapper{display:flex;flex-direction:column;min-height:100vh;width:100%}.container{margin:0 auto;max-width:90rem;width:100%;padding-left:2rem;padding-right:2rem}.fab{font-weight:400}.fas{font-weight:700}.float-right{float:right}.float-left{float:left}.fab{font-weight:400}.fas{font-weight:900}.content{flex:1;margin-top:1.6rem;margin-bottom:3.2rem}.content article header{margin-top:6.4rem;margin-bottom:3.2rem}.content article header h1,.content article header h2{margin:0}.content article header h2{font-size:1.8rem;line-height:2.2rem;color:#212121;margin-top:1.8rem}@media only screen and (max-device-width:768px){.content article header h2{font-size:1.6rem}}.content article footer{margin-top:4rem}.content .post .post-title{margin-bottom:.75em}.content .post .post-meta .posted-on{display:inline-block;margin-left:0;margin-right:1.5rem}.content .post .post-meta .reading-time{display:inline-block}.avatar img{width:20rem;height:auto;border-radius:50%}@media only screen and (max-device-width:768px){.avatar img{width:10rem}}.list ul{margin:3.2rem 0;list-style:none;padding:0}.list ul li{font-size:1.8rem}@media only screen and (max-device-width:768px){.list ul li{margin:1.6rem 0}}.list ul li span{display:inline-block;width:20rem;text-align:right;margin-right:3rem}@media only screen and (max-device-width:768px){.list ul li span{display:block;text-align:left}}.list ul li a{font-size:1.8rem;color:#212121;font-family:Lato,Helvetica,sans-serif;font-weight:700}.list ul li a:hover,.list ul li a:focus{color:#1565c0}.centered{display:flex;height:100%;align-items:center;justify-content:center}.centered .about{text-align:center}.centered .about h1{margin-top:2rem;margin-bottom:.5rem}.centered .about h2{margin-top:1rem;margin-bottom:.5rem;font-size:2.4rem}@media only screen and (max-device-width:768px){.centered .about h2{font-size:2rem}}.centered .about ul{list-style:none;margin:3rem 0 1rem;padding:0}.centered .about ul li{display:inline-block;position:relative}.centered .about ul li a{color:#212121;text-transform:uppercase;margin-left:1rem;margin-right:1rem;font-size:1.6rem}.centered .about ul li a:hover,.centered .about ul li a:focus{color:#1565c0}@media only screen and (max-device-width:768px){.centered .about ul li a{font-size:1.4rem}}.centered .about ul li a i{font-size:3.2rem}.centered .error{text-align:center}.centered .error h1{margin-top:2rem;margin-bottom:.5rem;font-size:4.6rem}@media only screen and (max-device-width:768px){.centered .error h1{font-size:3.2rem}}.centered .error h2{margin-top:2rem;margin-bottom:3.2rem;font-size:3.2rem}@media only screen and (max-device-width:768px){.centered .error h2{font-size:2.8rem}}.navigation{height:6rem;width:100%}.navigation a,.navigation span{display:inline;font-size:1.6rem;font-family:Lato,Helvetica,sans-serif;font-weight:700;line-height:6rem;color:#212121}.navigation a:hover,.navigation a:focus{color:#1565c0}.navigation .navigation-title{letter-spacing:.1rem;text-transform:uppercase}.navigation .navigation-list{float:right;list-style:none;margin-bottom:0;margin-top:0}@media only screen and (max-device-width:768px){.navigation .navigation-list{position:absolute;top:6rem;right:0;z-index:5;visibility:hidden;opacity:0;padding:0;max-height:0;width:100%;background-color:#fafafa;border-top:solid 2px #e0e0e0;border-bottom:solid 2px #e0e0e0;transition:opacity .25s,max-height .15s linear}}.navigation .navigation-list .navigation-item{float:left;margin:0;position:relative}@media only screen and (max-device-width:768px){.navigation .navigation-list .navigation-item{float:none!important;text-align:center}.navigation .navigation-list .navigation-item a,.navigation .navigation-list .navigation-item span{line-height:5rem}}.navigation .navigation-list .navigation-item a,.navigation .navigation-list .navigation-item span{margin-left:1rem;margin-right:1rem}@media only screen and (max-device-width:768px){.navigation .navigation-list .menu-separator{border-top:2px solid #212121;margin:0 8rem}.navigation .navigation-list .menu-separator span{display:none}}.navigation #menu-toggle{display:none}@media only screen and (max-device-width:768px){.navigation #menu-toggle:checked+label{color:#e0e0e0}.navigation #menu-toggle:checked+label+ul{visibility:visible;opacity:1;max-height:100rem}}.navigation .menu-button{display:none}@media only screen and (max-device-width:768px){.navigation .menu-button{display:block;font-size:2.4rem;font-weight:400;line-height:6rem;color:#212121;cursor:pointer}.navigation .menu-button:hover,.navigation .menu-button:focus{color:#1565c0}}.pagination{margin-top:6rem;text-align:center}.pagination li{display:inline;text-align:center}.pagination li span{margin:0;text-align:center;width:3.2rem}.pagination li a span{margin:0;text-align:center;width:3.2rem}.footer{width:100%;text-align:center;line-height:2rem;margin-bottom:1rem}.footer a{color:#1565c0}
\ No newline at end of file
+*,*:after,*:before{box-sizing:inherit}html{box-sizing:border-box;font-size:62.5%}body{display:flex;color:#212121;background-color:#fafafa;font-family:Merriweather,Georgia,serif;font-size:1.6em;font-weight:300;line-height:1.8em}@media only screen and (max-device-width:768px){body{font-size:1.6em;line-height:1.6em}}a{font-weight:300;color:#1565c0;text-decoration:none}a:focus,a:hover{text-decoration:underline}p{margin:2rem 0}h1,h2,h3,h4,h5,h6{font-family:Lato,Helvetica,sans-serif;font-weight:700;color:#000;margin:6.4rem 0 3.2rem}h1{font-size:3.2rem;line-height:3.6rem}@media only screen and (max-device-width:768px){h1{font-size:3rem;line-height:3.4rem}}h2{font-size:2.8rem;line-height:3.2rem}@media only screen and (max-device-width:768px){h2{font-size:2.6rem;line-height:3rem}}h3{font-size:2.4rem;line-height:2.8rem}@media only screen and (max-device-width:768px){h3{font-size:2.2rem;line-height:2.6rem}}h4{font-size:2.2rem;line-height:2.6rem}@media only screen and (max-device-width:768px){h4{font-size:2rem;line-height:2.4rem}}h5{font-size:2rem;line-height:2.4rem}@media only screen and (max-device-width:768px){h5{font-size:1.8rem;line-height:2.2rem}}h6{font-size:1.8rem;line-height:2.2rem}@media only screen and (max-device-width:768px){h6{font-size:1.6rem;line-height:2rem}}b,strong{font-weight:700}pre{display:block;font-family:source code pro,lucida console,monospace;font-size:1.6rem;font-weight:400;line-height:2.6rem;margin:2rem 0;padding:2rem;overflow-x:auto}pre code{background-color:inherit;color:inherit}code{font-family:source code pro,lucida console,monospace;font-size:1.6rem;font-weight:400;background-color:#e0e0e0;color:#212121;padding:.2rem .4rem}blockquote{border-left:2px solid #e0e0e0;padding-left:2rem;line-height:2.2rem;font-weight:400;font-style:italic}th,td{padding:1.6rem}table{border-collapse:collapse}table td,table th{border:2px solid #000}table tr:first-child th{border-top:0}table tr:last-child td{border-bottom:0}table tr td:first-child,table tr th:first-child{border-left:0}table tr td:last-child,table tr th:last-child{border-right:0}img{max-width:100%}.wrapper{display:flex;flex-direction:column;min-height:100vh;width:100%}.container{margin:0 auto;max-width:90rem;width:100%;padding-left:2rem;padding-right:2rem}.fab{font-weight:400}.fas{font-weight:700}.float-right{float:right}.float-left{float:left}.fab{font-weight:400}.fas{font-weight:900}.content{flex:1;margin-top:1.6rem;margin-bottom:3.2rem}.content article header{margin-top:6.4rem;margin-bottom:3.2rem}.content article header h1,.content article header h2{margin:0}.content article header h2{font-size:1.8rem;line-height:2.2rem;color:#212121;margin-top:1.8rem;margin-bottom:1.8rem}@media only screen and (max-device-width:768px){.content article header h2{font-size:1.6rem}}.content article footer{margin-top:4rem}.content .post .post-title{margin-bottom:.75em}.content .post .post-meta .posted-on{display:inline-block;margin-left:0;margin-right:1.5rem}.content .post .post-meta .reading-time{display:inline-block}.content .post .tags i,.content .post .categories i{margin-left:0;margin-right:.5rem}.content .post .tags .separator,.content .post .categories .separator{margin-left:.5rem;margin-right:.5rem}.avatar img{width:20rem;height:auto;border-radius:50%}@media only screen and (max-device-width:768px){.avatar img{width:10rem}}.list ul{margin:3.2rem 0;list-style:none;padding:0}.list ul li{font-size:1.8rem}@media only screen and (max-device-width:768px){.list ul li{margin:1.6rem 0}}.list ul li span{display:inline-block;width:20rem;text-align:right;margin-right:3rem}@media only screen and (max-device-width:768px){.list ul li span{display:block;text-align:left}}.list ul li a{font-size:1.8rem;color:#212121;font-family:Lato,Helvetica,sans-serif;font-weight:700}.list ul li a:hover,.list ul li a:focus{color:#1565c0}.centered{display:flex;height:100%;align-items:center;justify-content:center}.centered .about{text-align:center}.centered .about h1{margin-top:2rem;margin-bottom:.5rem}.centered .about h2{margin-top:1rem;margin-bottom:.5rem;font-size:2.4rem}@media only screen and (max-device-width:768px){.centered .about h2{font-size:2rem}}.centered .about ul{list-style:none;margin:3rem 0 1rem;padding:0}.centered .about ul li{display:inline-block;position:relative}.centered .about ul li a{color:#212121;text-transform:uppercase;margin-left:1rem;margin-right:1rem;font-size:1.6rem}.centered .about ul li a:hover,.centered .about ul li a:focus{color:#1565c0}@media only screen and (max-device-width:768px){.centered .about ul li a{font-size:1.4rem}}.centered .about ul li a i{font-size:3.2rem}.centered .error{text-align:center}.centered .error h1{margin-top:2rem;margin-bottom:.5rem;font-size:4.6rem}@media only screen and (max-device-width:768px){.centered .error h1{font-size:3.2rem}}.centered .error h2{margin-top:2rem;margin-bottom:3.2rem;font-size:3.2rem}@media only screen and (max-device-width:768px){.centered .error h2{font-size:2.8rem}}.navigation{height:6rem;width:100%}.navigation a,.navigation span{display:inline;font-size:1.6rem;font-family:Lato,Helvetica,sans-serif;font-weight:700;line-height:6rem;color:#212121}.navigation a:hover,.navigation a:focus{color:#1565c0}.navigation .navigation-title{letter-spacing:.1rem;text-transform:uppercase}.navigation .navigation-list{float:right;list-style:none;margin-bottom:0;margin-top:0}@media only screen and (max-device-width:768px){.navigation .navigation-list{position:absolute;top:6rem;right:0;z-index:5;visibility:hidden;opacity:0;padding:0;max-height:0;width:100%;background-color:#fafafa;border-top:solid 2px #e0e0e0;border-bottom:solid 2px #e0e0e0;transition:opacity .25s,max-height .15s linear}}.navigation .navigation-list .navigation-item{float:left;margin:0;position:relative}@media only screen and (max-device-width:768px){.navigation .navigation-list .navigation-item{float:none!important;text-align:center}.navigation .navigation-list .navigation-item a,.navigation .navigation-list .navigation-item span{line-height:5rem}}.navigation .navigation-list .navigation-item a,.navigation .navigation-list .navigation-item span{margin-left:1rem;margin-right:1rem}@media only screen and (max-device-width:768px){.navigation .navigation-list .menu-separator{border-top:2px solid #212121;margin:0 8rem}.navigation .navigation-list .menu-separator span{display:none}}.navigation #menu-toggle{display:none}@media only screen and (max-device-width:768px){.navigation #menu-toggle:checked+label{color:#e0e0e0}.navigation #menu-toggle:checked+label+ul{visibility:visible;opacity:1;max-height:100rem}}.navigation .menu-button{display:none}@media only screen and (max-device-width:768px){.navigation .menu-button{display:block;font-size:2.4rem;font-weight:400;line-height:6rem;color:#212121;cursor:pointer}.navigation .menu-button:hover,.navigation .menu-button:focus{color:#1565c0}}.pagination{margin-top:6rem;text-align:center}.pagination li{display:inline;text-align:center}.pagination li span{margin:0;text-align:center;width:3.2rem}.pagination li a span{margin:0;text-align:center;width:3.2rem}.footer{width:100%;text-align:center;line-height:2rem;margin-bottom:1rem}.footer a{color:#1565c0}
\ No newline at end of file
diff --git a/resources/_gen/assets/scss/scss/coder.scss_5e1eb8e37c42cdfb6215b61e44dcfa5f.json b/resources/_gen/assets/scss/scss/coder.scss_5e1eb8e37c42cdfb6215b61e44dcfa5f.json
index 90f002f..fd84d11 100644
--- a/resources/_gen/assets/scss/scss/coder.scss_5e1eb8e37c42cdfb6215b61e44dcfa5f.json
+++ b/resources/_gen/assets/scss/scss/coder.scss_5e1eb8e37c42cdfb6215b61e44dcfa5f.json
@@ -1 +1 @@
-{"Target":"css/coder.min.da5204b40ef8cbcb52b75a8cac5656a9cebc00a15e25c865a4b84a3c06b3ed82.css","MediaType":"text/css","Data":{"Integrity":"sha256-2lIEtA74y8tSt1qMrFZWqc68AKFeJchlpLhKPAaz7YI="}}
\ No newline at end of file
+{"Target":"css/coder.min.cf79e6c3b1f6a5f3b633af689738b135c8ae60005166ed909a402efbb88959e2.css","MediaType":"text/css","Data":{"Integrity":"sha256-z3nmw7H2pfO2M69olzixNciuYABRZu2QmkAu+7iJWeI="}}
\ No newline at end of file

--
Gitblit v1.10.0