feat: faster, support custom lib cdn and more standardized code style
This commit is contained in:
@@ -1,25 +1,17 @@
|
||||
{{ define "title" }}{{ .Title }} - {{ .Site.Title }}{{ end }}
|
||||
{{ define "title" }}{{ T .Data.Plural | default (humanize .Data.Plural) }} | {{ .Site.Title }}{{ end }}
|
||||
|
||||
{{ define "content" }}
|
||||
{{ $taxonomy := .Data.Singular }}
|
||||
{{ $taxonomysName := $taxonomy }}
|
||||
{{ if eq $taxonomy "tag"}}
|
||||
{{ $taxonomysName = (T "tags") }}
|
||||
{{ else if eq $taxonomy "category"}}
|
||||
{{ $taxonomysName = (T "categories") }}
|
||||
{{ end }}
|
||||
|
||||
{{ $taxonomies := .Data.Plural }}
|
||||
{{ $terms := .Data.Terms.ByCount }}
|
||||
{{ $length := len $terms }}
|
||||
{{ $type := .Type }}
|
||||
|
||||
<div class="post-warp archive">
|
||||
<h2 class="post-title">
|
||||
{{- printf "- %s -" $taxonomysName -}}
|
||||
{{- printf "%s%s" (T "all") (T $taxonomies | default (humanize $taxonomies)) -}}
|
||||
</h2>
|
||||
|
||||
<!-- Categories Page -->
|
||||
{{ if eq $taxonomy "category" }}
|
||||
{{ if eq $taxonomies "categories" }}
|
||||
<div class="categories-card">
|
||||
{{ range $terms }}
|
||||
{{ $term := .Term }}
|
||||
@@ -47,7 +39,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Tag Cloud Page -->
|
||||
{{ else if eq $taxonomy "tag" }}
|
||||
{{ else if eq $taxonomies "tags" }}
|
||||
<div class="tag-cloud-tags">
|
||||
{{ range $.Site.Taxonomies.tags.ByCount }}
|
||||
<a href="{{ .Page.Permalink }}"> {{ .Page.Title }} <small>({{ .Count }})</small></a>
|
||||
|
||||
Reference in New Issue
Block a user