Taxonomy initial commit, tags and categories (#90)

* Taxonomy initial commit, tags and categories

* WIP: Show in footer for comparison

* Fix post meta
This commit is contained in:
Khosrow Moossavi
2018-10-27 08:43:26 -04:00
committed by Luiz F. A. de Prá
parent 764b9ffef3
commit fd3ec89897
9 changed files with 70 additions and 27 deletions

View File

@@ -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" . }}

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>