mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
🎉 Feat: add taxonomy collections
This commit is contained in:
@@ -991,3 +991,14 @@ enableEmoji = true
|
||||
section = ["HTML", "RSS"]
|
||||
taxonomy = ["HTML"]
|
||||
term = ["HTML", "RSS"]
|
||||
|
||||
# -------------------------------------------------------------------------------------
|
||||
# Taxonomies Configuration
|
||||
# See: https://gohugo.io/content-management/taxonomies/#configure-taxonomies
|
||||
# -------------------------------------------------------------------------------------
|
||||
|
||||
[taxonomies]
|
||||
# series = "series"
|
||||
category = "categories"
|
||||
tag = "tags"
|
||||
collections = "collections"
|
||||
|
||||
@@ -29,6 +29,12 @@ other = "Kategorie"
|
||||
[categories]
|
||||
other = "Kategorien"
|
||||
|
||||
[collection]
|
||||
other = ""
|
||||
|
||||
[collections]
|
||||
other = ""
|
||||
|
||||
[tag]
|
||||
other = "Tag"
|
||||
|
||||
|
||||
+10
-4
@@ -27,6 +27,12 @@ other = "Category"
|
||||
[categories]
|
||||
other = "Categories"
|
||||
|
||||
[collection]
|
||||
other = "Collection"
|
||||
|
||||
[collections]
|
||||
other = "Collections"
|
||||
|
||||
[tag]
|
||||
other = "Tag"
|
||||
|
||||
@@ -96,10 +102,10 @@ other = "Share on"
|
||||
|
||||
# === posts/single.html ===
|
||||
[single]
|
||||
contents= "Contents"
|
||||
repost= "Repost"
|
||||
publishedOnDate= "published on {{ .Date }}"
|
||||
includedInCategories= "included in {{ .Categories }}"
|
||||
contents = "Contents"
|
||||
repost = "Repost"
|
||||
publishedOnDate = "published on {{ .Date }}"
|
||||
includedInCategories = "included in {{ .Categories }}"
|
||||
views = "views"
|
||||
comments = "comments"
|
||||
author = "Author"
|
||||
|
||||
@@ -29,6 +29,12 @@ other = "Categoría"
|
||||
[categories]
|
||||
other = "Categorías"
|
||||
|
||||
[collection]
|
||||
other = ""
|
||||
|
||||
[collections]
|
||||
other = ""
|
||||
|
||||
[tag]
|
||||
other = "Etiqueta"
|
||||
|
||||
|
||||
@@ -28,6 +28,12 @@ other = "Catégorie"
|
||||
[categories]
|
||||
other = "Catégories"
|
||||
|
||||
[collection]
|
||||
other = ""
|
||||
|
||||
[collections]
|
||||
other = ""
|
||||
|
||||
[tag]
|
||||
other = "Tag"
|
||||
|
||||
|
||||
@@ -29,6 +29,12 @@ other = "Categoria"
|
||||
[categories]
|
||||
other = "Categorie"
|
||||
|
||||
[collection]
|
||||
other = ""
|
||||
|
||||
[collections]
|
||||
other = ""
|
||||
|
||||
[tag]
|
||||
other = "Etichetta"
|
||||
|
||||
|
||||
@@ -29,6 +29,12 @@ other = "Kategoria"
|
||||
[categories]
|
||||
other = "Kategorie"
|
||||
|
||||
[collection]
|
||||
other = ""
|
||||
|
||||
[collections]
|
||||
other = ""
|
||||
|
||||
[tag]
|
||||
other = "Tag"
|
||||
|
||||
|
||||
@@ -29,6 +29,12 @@ other = "Categoria"
|
||||
[categories]
|
||||
other = "Categorias"
|
||||
|
||||
[collection]
|
||||
other = ""
|
||||
|
||||
[collections]
|
||||
other = ""
|
||||
|
||||
[tag]
|
||||
other = "Tag"
|
||||
|
||||
|
||||
@@ -29,6 +29,12 @@ other = "Categorie"
|
||||
[categories]
|
||||
other = "Categorii"
|
||||
|
||||
[collection]
|
||||
other = ""
|
||||
|
||||
[collections]
|
||||
other = ""
|
||||
|
||||
[tag]
|
||||
other = "Etichetă"
|
||||
|
||||
|
||||
@@ -29,6 +29,12 @@ other = "Категория"
|
||||
[categories]
|
||||
other = "Категории"
|
||||
|
||||
[collection]
|
||||
other = ""
|
||||
|
||||
[collections]
|
||||
other = ""
|
||||
|
||||
[tag]
|
||||
other = "Тэг"
|
||||
|
||||
|
||||
@@ -29,6 +29,12 @@ other = "Категорија"
|
||||
[categories]
|
||||
other = "Категорије"
|
||||
|
||||
[collection]
|
||||
other = ""
|
||||
|
||||
[collections]
|
||||
other = ""
|
||||
|
||||
[tag]
|
||||
other = "Таг"
|
||||
|
||||
|
||||
@@ -28,6 +28,12 @@ other = "Danh mục"
|
||||
[categories]
|
||||
other = "Danh mục"
|
||||
|
||||
[collection]
|
||||
other = ""
|
||||
|
||||
[collections]
|
||||
other = ""
|
||||
|
||||
[tag]
|
||||
other = "Nhãn"
|
||||
|
||||
|
||||
@@ -28,6 +28,12 @@ other = "分类"
|
||||
[categories]
|
||||
other = "分类"
|
||||
|
||||
[collection]
|
||||
other = "合集"
|
||||
|
||||
[collections]
|
||||
other = "合集"
|
||||
|
||||
[tag]
|
||||
other = "标签"
|
||||
|
||||
|
||||
@@ -28,6 +28,12 @@ other = "分類"
|
||||
[categories]
|
||||
other = "分類"
|
||||
|
||||
[collection]
|
||||
other = "合集"
|
||||
|
||||
[collections]
|
||||
other = "合集"
|
||||
|
||||
[tag]
|
||||
other = "標籤"
|
||||
|
||||
|
||||
+17
-11
@@ -5,18 +5,24 @@
|
||||
{{- define "content" -}}
|
||||
<div class="page archive">
|
||||
{{- /* Title */ -}}
|
||||
{{- $taxonomy := .Data.Singular -}}
|
||||
{{- $pageCount := len .Pages -}}
|
||||
{{- $termIcon := "" -}}
|
||||
{{- $termTitle := .Title -}}
|
||||
{{- if eq $taxonomy "category" -}}
|
||||
{{- $termIcon = "fa-regular fa-folder-open fa-fw" -}}
|
||||
{{- else if eq $taxonomy "tag" -}}
|
||||
{{- $termIcon = "fa-solid fa-tag fa-fw" -}}
|
||||
{{- else if eq $taxonomy "collections" -}}
|
||||
{{- $termIcon = "fa-solid fa-layer-group fa-fw" -}}
|
||||
{{- else -}}
|
||||
{{- $termTitle = printf "%v - %v" (T $taxonomy | default $taxonomy) .Title -}}
|
||||
{{- end -}}
|
||||
<h2 class="single-title animate__animated animate__pulse animate__faster">
|
||||
{{- $taxonomy := .Data.Singular -}}
|
||||
{{- $pageCount := len .Pages -}}
|
||||
{{- if eq $taxonomy "category" -}}
|
||||
{{ dict "Class" "fa-regular fa-folder-open fa-fw" | partial "plugin/icon.html" }}
|
||||
{{ .Title }} <sup>{{- $pageCount -}}</sup>
|
||||
{{- else if eq $taxonomy "tag" -}}
|
||||
{{ dict "Class" "fa-solid fa-tag fa-fw" | partial "plugin/icon.html" }}
|
||||
{{ .Title }} <sup>{{- $pageCount -}}</sup>
|
||||
{{- else -}}
|
||||
{{- printf "%v - %v" (T $taxonomy | default $taxonomy) .Title -}}
|
||||
{{- end -}}
|
||||
{{- with $termIcon -}}
|
||||
{{- dict "Class" . | partial "plugin/icon.html" }}
|
||||
{{ end -}}
|
||||
{{ $termTitle }} <sup>{{- $pageCount -}}</sup>
|
||||
</h2>
|
||||
|
||||
{{- /* Paginate */ -}}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
{{- /* Collections Page */ -}}
|
||||
|
||||
<div class="categories-card">
|
||||
{{- range .Data.Terms.ByCount -}}
|
||||
{{- $term := .Term -}}
|
||||
{{- $pages := .Pages -}}
|
||||
{{- with $.Site.GetPage "taxonomy" (printf "%v/%v" $.Type $term) -}}
|
||||
<div class="card-item">
|
||||
<div class="card-item-wrapper">
|
||||
<h3 class="card-item-title">
|
||||
<a href='{{ partial "function/escapeurl.html" .RelPermalink }}'>
|
||||
{{ dict "Class" "fa-solid fa-layer-group fa-fw" | partial "plugin/icon.html" }}
|
||||
{{ .Page.Title }} <sup>{{- len $pages -}}</sup>
|
||||
</a>
|
||||
</h3>
|
||||
{{- range first 5 $pages -}}
|
||||
<article class="archive-item">
|
||||
<a href="{{ .RelPermalink }}" class="archive-item-link">{{- .Title -}}</a>
|
||||
</article>
|
||||
{{- end -}}
|
||||
{{- if gt (len $pages) 5 -}}
|
||||
<span class="more-post">
|
||||
<a href='{{ partial "function/escapeurl.html" .RelPermalink }}' class="more-single-link">{{ T "pagination.more" }} >></a>
|
||||
</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
Reference in New Issue
Block a user