mirror of
https://github.com/13hannes11/hugo-coder-timeline.git
synced 2024-09-04 00:50:58 +02:00
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:
committed by
Luiz F. A. de Prá
parent
764b9ffef3
commit
fd3ec89897
@@ -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" . }}
|
||||
|
||||
@@ -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>
|
||||
|
||||
9
layouts/partials/taxonomy/categories.html
Normal file
9
layouts/partials/taxonomy/categories.html
Normal 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>
|
||||
9
layouts/partials/taxonomy/tags.html
Normal file
9
layouts/partials/taxonomy/tags.html
Normal 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>
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user