Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/uPagge/uBlogger.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDillon <dillonzq@outlook.com>2020-04-22 20:22:29 +0300
committerGitHub <noreply@github.com>2020-04-22 20:22:29 +0300
commitd90a2d9406aa883548b48bb6da8e828d2d8e4dad (patch)
tree509af2a696e88f109dddfd181c3ed39f3562562a /layouts
parent07b669c826f9250e6593e880f80c63bf70f5a746 (diff)
fix: some title case bugs for section page and list page (#251)
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/section.html4
-rw-r--r--layouts/_default/summary.html8
-rw-r--r--layouts/index.rss.xml (renamed from layouts/inde.rss.xml)0
-rw-r--r--layouts/partials/single/footer.html3
-rw-r--r--layouts/posts/rss.xml4
-rw-r--r--layouts/posts/single.html5
-rw-r--r--layouts/taxonomy/list.html8
-rw-r--r--layouts/taxonomy/rss.xml4
-rw-r--r--layouts/taxonomy/terms.html8
9 files changed, 24 insertions, 20 deletions
diff --git a/layouts/_default/section.html b/layouts/_default/section.html
index 2d037bc..89ebcba 100644
--- a/layouts/_default/section.html
+++ b/layouts/_default/section.html
@@ -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 */ -}}
diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html
index df0445c..419a869 100644
--- a/layouts/_default/summary.html
+++ b/layouts/_default/summary.html
@@ -33,8 +33,9 @@
{{- T "included" -}}
{{- range $index, $value := . -}}
{{- if gt $index 0 }}&nbsp;{{ 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>&nbsp;
{{- range $index, $value := . -}}
{{- if gt $index 0 }},&nbsp;{{ 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 -}}
diff --git a/layouts/inde.rss.xml b/layouts/index.rss.xml
index 263082b..263082b 100644
--- a/layouts/inde.rss.xml
+++ b/layouts/index.rss.xml
diff --git a/layouts/partials/single/footer.html b/layouts/partials/single/footer.html
index f76e5a6..249f9ff 100644
--- a/layouts/partials/single/footer.html
+++ b/layouts/partials/single/footer.html
@@ -48,7 +48,8 @@
<i class="fas fa-tags fa-fw"></i>&nbsp;
{{- range $index, $value := . -}}
{{- if gt $index 0 }},&nbsp;{{ 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>
diff --git a/layouts/posts/rss.xml b/layouts/posts/rss.xml
index 49aba41..7d148d1 100644
--- a/layouts/posts/rss.xml
+++ b/layouts/posts/rss.xml
@@ -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 -}}
diff --git a/layouts/posts/single.html b/layouts/posts/single.html
index 2e3abc2..e271537 100644
--- a/layouts/posts/single.html
+++ b/layouts/posts/single.html
@@ -36,8 +36,9 @@
{{- T "included" -}}
{{- range $index, $value := . -}}
{{- if gt $index 0 }}&nbsp;{{ 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>
diff --git a/layouts/taxonomy/list.html b/layouts/taxonomy/list.html
index cd60dba..d770be0 100644
--- a/layouts/taxonomy/list.html
+++ b/layouts/taxonomy/list.html
@@ -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>&nbsp;{{ humanize .Title }}
+ <i class="far fa-folder-open fa-fw"></i>&nbsp;{{ .Title }}
{{- else if eq $taxonomy "tag" -}}
- <i class="fas fa-tag fa-fw"></i>&nbsp;{{ humanize .Title }}
+ <i class="fas fa-tag fa-fw"></i>&nbsp;{{ .Title }}
{{- else -}}
- {{- printf "%s - %s" (T $taxonomy | default (humanize $taxonomy)) .Title -}}
+ {{- printf "%s - %s" (T $taxonomy | default $taxonomy) .Title -}}
{{- end -}}
</h2>
diff --git a/layouts/taxonomy/rss.xml b/layouts/taxonomy/rss.xml
index 4f9bed6..2d79cfa 100644
--- a/layouts/taxonomy/rss.xml
+++ b/layouts/taxonomy/rss.xml
@@ -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 -}}
diff --git a/layouts/taxonomy/terms.html b/layouts/taxonomy/terms.html
index 28062a5..6722c66 100644
--- a/layouts/taxonomy/terms.html
+++ b/layouts/taxonomy/terms.html
@@ -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>&nbsp;{{ $term | humanize}}
+ <i class="far fa-folder fa-fw"></i>&nbsp;{{ .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 -}}