fix: some title case bugs for section page and list page (#251)
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
{{- define "title" }}
|
||||
{{- T .Section | default .Section | printf (T "allSome") }} | {{ .Site.Title -}}
|
||||
{{- .Title | default (T .Section) | default .Section | printf (T "allSome") }} | {{ .Site.Title -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "content" -}}
|
||||
<div class="page archive">
|
||||
{{- /* Title */ -}}
|
||||
<h2 class="single-title animated pulse faster">
|
||||
{{- T .Section | default .Section | humanize | printf (T "allSome") -}}
|
||||
{{- .Title | default (T .Section) | default .Section | printf (T "allSome") -}}
|
||||
</h2>
|
||||
|
||||
{{- /* Paginate */ -}}
|
||||
|
||||
@@ -33,8 +33,9 @@
|
||||
{{- T "included" -}}
|
||||
{{- range $index, $value := . -}}
|
||||
{{- if gt $index 0 }} {{ end -}}
|
||||
<a href="{{ `/categories/` | relLangURL }}{{ urlize $value }}">
|
||||
<i class="far fa-folder fa-fw"></i>{{ $value | humanize }}
|
||||
{{- $category := printf "/categories/%s" $value | $.Site.GetPage -}}
|
||||
<a href="{{ $category.RelPermalink }}">
|
||||
<i class="far fa-folder fa-fw"></i>{{ $category.Title }}
|
||||
</a>
|
||||
{{- end -}}
|
||||
</span>
|
||||
@@ -58,7 +59,8 @@
|
||||
<i class="fas fa-tags fa-fw"></i>
|
||||
{{- range $index, $value := . -}}
|
||||
{{- if gt $index 0 }}, {{ end -}}
|
||||
<a href="{{ `/tags/` | relLangURL }}{{ urlize $value }}">{{ $value }}</a>
|
||||
{{- $tag := printf "/tags/%s" $value | $.Site.GetPage -}}
|
||||
<a href="{{ $tag.RelPermalink }}">{{ $tag.Title }}</a>
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
@@ -48,7 +48,8 @@
|
||||
<i class="fas fa-tags fa-fw"></i>
|
||||
{{- range $index, $value := . -}}
|
||||
{{- if gt $index 0 }}, {{ end -}}
|
||||
<a href="{{ `/tags/` | relLangURL }}{{ urlize $value }}">{{ $value }}</a>
|
||||
{{- $tag := printf "/tags/%s" $value | $.Site.GetPage -}}
|
||||
<a href="{{ $tag.RelPermalink }}">{{ $tag.Title }}</a>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</section>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
|
||||
<channel>
|
||||
<title>
|
||||
{{- T .Section | default .Section | printf (T "allSome") }} | {{ .Site.Title -}}
|
||||
{{- .Title | default (T .Section) | default .Section | printf (T "allSome") }} | {{ .Site.Title -}}
|
||||
</title>
|
||||
<link>
|
||||
{{- .Permalink -}}
|
||||
</link>
|
||||
<description>
|
||||
{{- T .Section | default .Section | printf (T "allSome") }} | {{ .Site.Title -}}
|
||||
{{- .Title | default (T .Section) | default .Section | printf (T "allSome") }} | {{ .Site.Title -}}
|
||||
</description>
|
||||
<generator>Hugo -- gohugo.io</generator>
|
||||
{{- with .Site.LanguageCode -}}
|
||||
|
||||
@@ -36,8 +36,9 @@
|
||||
{{- T "included" -}}
|
||||
{{- range $index, $value := . -}}
|
||||
{{- if gt $index 0 }} {{ end -}}
|
||||
<a href="{{ `/categories/` | relLangURL }}{{ urlize $value }}">
|
||||
<i class="far fa-folder fa-fw"></i>{{ $value | humanize }}
|
||||
{{- $category := printf "/categories/%s" $value | $.Site.GetPage -}}
|
||||
<a href="{{ $category.RelPermalink }}">
|
||||
<i class="far fa-folder fa-fw"></i>{{ $category.Title }}
|
||||
</a>
|
||||
{{- end -}}
|
||||
</span>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{- define "title" -}}
|
||||
{{- .Title }} | {{ T .Data.Singular | default (humanize .Data.Singular) }} | {{ .Site.Title -}}
|
||||
{{- .Title }} | {{ T .Data.Singular | default .Data.Singular }} | {{ .Site.Title -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "content" -}}
|
||||
@@ -8,11 +8,11 @@
|
||||
<h2 class="single-title animated pulse faster">
|
||||
{{- $taxonomy := .Data.Singular -}}
|
||||
{{- if eq $taxonomy "category" -}}
|
||||
<i class="far fa-folder-open fa-fw"></i> {{ humanize .Title }}
|
||||
<i class="far fa-folder-open fa-fw"></i> {{ .Title }}
|
||||
{{- else if eq $taxonomy "tag" -}}
|
||||
<i class="fas fa-tag fa-fw"></i> {{ humanize .Title }}
|
||||
<i class="fas fa-tag fa-fw"></i> {{ .Title }}
|
||||
{{- else -}}
|
||||
{{- printf "%s - %s" (T $taxonomy | default (humanize $taxonomy)) .Title -}}
|
||||
{{- printf "%s - %s" (T $taxonomy | default $taxonomy) .Title -}}
|
||||
{{- end -}}
|
||||
</h2>
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
|
||||
<channel>
|
||||
<title>
|
||||
{{- .Title }} | {{ T .Data.Singular | default (humanize .Data.Singular) }} | {{ .Site.Title -}}
|
||||
{{- .Title }} | {{ T .Data.Singular | default .Data.Singular }} | {{ .Site.Title -}}
|
||||
</title>
|
||||
<link>
|
||||
{{- .Permalink -}}
|
||||
</link>
|
||||
<description>
|
||||
{{- .Title }} | {{ T .Data.Singular | default (humanize .Data.Singular) }} | {{ .Site.Title -}}
|
||||
{{- .Title }} | {{ T .Data.Singular | default .Data.Singular }} | {{ .Site.Title -}}
|
||||
</description>
|
||||
<generator>Hugo -- gohugo.io</generator>
|
||||
{{- with .Site.LanguageCode -}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{- define "title" -}}
|
||||
{{- .Title | default (T .Data.Plural) | default (humanize .Data.Plural) }} | {{ .Site.Title -}}
|
||||
{{- .Title | default (T .Data.Plural) | default .Data.Plural }} | {{ .Site.Title -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "content" -}}
|
||||
@@ -10,7 +10,7 @@
|
||||
<div class="page archive">
|
||||
{{- /* Title */ -}}
|
||||
<h2 class="single-title animated pulse faster">
|
||||
{{- T "all" | humanize}}{{ T $taxonomies | default $taxonomies | humanize -}}
|
||||
{{- T "all" }}{{ T $taxonomies | default $taxonomies -}}
|
||||
</h2>
|
||||
|
||||
{{- /* Categories Page */ -}}
|
||||
@@ -24,7 +24,7 @@
|
||||
<div class="card-item-wrapper">
|
||||
<h3 class="card-item-title">
|
||||
<a href="{{ .RelPermalink }}">
|
||||
<i class="far fa-folder fa-fw"></i> {{ $term | humanize}}
|
||||
<i class="far fa-folder fa-fw"></i> {{ .Page.Title }}
|
||||
</a>
|
||||
</h3>
|
||||
{{- range first 5 $pages -}}
|
||||
@@ -49,7 +49,7 @@
|
||||
{{- else if eq $taxonomies "tags" -}}
|
||||
<div class="tag-cloud-tags">
|
||||
{{- range $.Site.Taxonomies.tags.ByCount -}}
|
||||
<a href="{{ .Page.RelPermalink }}"> {{ .Page.Title }} <sup>{{ .Count }}</sup></a>
|
||||
<a href="{{ .Page.RelPermalink }}">{{ .Page.Title }} <sup>{{ .Count }}</sup></a>
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
Reference in New Issue
Block a user