diff options
author | Patrick Collins <thepatrickcollins@gmail.com> | 2020-06-04 20:06:54 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-04 20:06:54 +0300 |
commit | 0043196f53cb21fee6c7a78674b3a1ca8e6269bc (patch) | |
tree | 728b7d17f8fb94a02860a1c2519e52c8f3607c5b | |
parent | 7d4e0cd1be3d9542c8e3adf1add507a8006fb9f3 (diff) |
Fix terms URL (#146)
-rw-r--r-- | i18n/de.toml | 2 | ||||
-rw-r--r-- | i18n/en.toml | 2 | ||||
-rw-r--r-- | i18n/es.toml | 2 | ||||
-rw-r--r-- | i18n/fr.toml | 2 | ||||
-rw-r--r-- | i18n/ja.toml | 2 | ||||
-rw-r--r-- | i18n/pl.toml | 2 | ||||
-rw-r--r-- | i18n/pt.toml | 2 | ||||
-rw-r--r-- | i18n/zh-CN.toml | 2 | ||||
-rw-r--r-- | i18n/zh-TW.toml | 2 | ||||
-rw-r--r-- | layouts/_default/stats.html | 60 | ||||
-rw-r--r-- | layouts/_default/terms.html | 17 | ||||
-rw-r--r-- | layouts/partials/footer-category.html | 44 | ||||
-rw-r--r-- | layouts/taxonomy/category.html | 21 | ||||
-rw-r--r-- | layouts/taxonomy/category.terms.html | 40 | ||||
-rw-r--r-- | layouts/taxonomy/tag.html | 21 | ||||
-rw-r--r-- | layouts/taxonomy/tag.terms.html | 40 |
16 files changed, 41 insertions, 220 deletions
diff --git a/i18n/de.toml b/i18n/de.toml index 80e3cfb..9acf4b0 100644 --- a/i18n/de.toml +++ b/i18n/de.toml @@ -17,8 +17,6 @@ other = "Tags" [tag] other = "Tag" -[uncategorized] - other = "Unkategorisiert" [share_post] other = "Teilen" [check_out] diff --git a/i18n/en.toml b/i18n/en.toml index ceb27ec..32c09c4 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -17,8 +17,6 @@ other = "Tags" [tag] other = "Tag" -[uncategorized] - other = "Uncategorized" [share_post] other = "Share this post" [check_out] diff --git a/i18n/es.toml b/i18n/es.toml index 14fcbf6..5309c39 100644 --- a/i18n/es.toml +++ b/i18n/es.toml @@ -17,8 +17,6 @@ other = "Tags" [tag] other = "Tag" -[uncategorized] - other = "Sin categoría" [share_post] other = "Compartir post" [check_out] diff --git a/i18n/fr.toml b/i18n/fr.toml index 0939316..c338643 100644 --- a/i18n/fr.toml +++ b/i18n/fr.toml @@ -17,8 +17,6 @@ other = "Tags" [tag] other = "Tag" -[uncategorized] - other = "Non catégorisé" [share_post] other = "Partager ce post" [check_out] diff --git a/i18n/ja.toml b/i18n/ja.toml index 3544d38..e00ae44 100644 --- a/i18n/ja.toml +++ b/i18n/ja.toml @@ -17,8 +17,6 @@ other = "タグ" [tag] other = "タグ" -[uncategorized] - other = "未分類" [share_post] other = "この投稿をシェアする" [check_out] diff --git a/i18n/pl.toml b/i18n/pl.toml index b78ec55..800bf18 100644 --- a/i18n/pl.toml +++ b/i18n/pl.toml @@ -19,8 +19,6 @@ other = "Tagi" [tag] other = "Tag" -[uncategorized] - other = "Bez kategorii" [share_post] other = "Udostępnij ten post" [check_out] diff --git a/i18n/pt.toml b/i18n/pt.toml index 4dfb8fb..4306065 100644 --- a/i18n/pt.toml +++ b/i18n/pt.toml @@ -19,8 +19,6 @@ other = "Tags" [tag] other = "Tag" -[uncategorized] - other = "Sem categoria" [share_post] other = "Compartilhe este post" [check_out] diff --git a/i18n/zh-CN.toml b/i18n/zh-CN.toml index 727a091..bb1a3df 100644 --- a/i18n/zh-CN.toml +++ b/i18n/zh-CN.toml @@ -16,8 +16,6 @@ other = "标签" [tag] other = "标签" -[uncategorized] - other = "未分类" [share_post] other = "分享这篇文章" [check_out] diff --git a/i18n/zh-TW.toml b/i18n/zh-TW.toml index bca95f3..b312556 100644 --- a/i18n/zh-TW.toml +++ b/i18n/zh-TW.toml @@ -16,8 +16,6 @@ other = "標籤" [tag] other = "標籤" -[uncategorized] - other = "未分類" [share_post] other = "分享這篇文章" [check_out] diff --git a/layouts/_default/stats.html b/layouts/_default/stats.html index 341eb30..222d880 100644 --- a/layouts/_default/stats.html +++ b/layouts/_default/stats.html @@ -1,40 +1,28 @@ <ul class="stats"> - {{ if isset .Params "categories" }} - {{ $categoriesLen := len .Params.categories }} - {{ if gt $categoriesLen 0 }} - <li class="categories"> - <ul> - {{ range $k, $v := .Params.categories }} - {{ $url := printf "categories/%s" (. | urlize | lower) }} - <li><a class="article-category-link" href="{{ $url | absLangURL }}">{{ . }}</a></li> - {{ end }} - </ul> - </li> + <li class="categories"> + <ul> + {{ if isset .Params "categories" }} + {{ if gt (len .Params.categories) 0 }} + {{ range .Params.categories }} + <li><a class="article-terms-link" href="{{ path.Join "categories" (. | urlize | lower) | relLangURL }}/">{{ . }}</a></li> + {{ end }} + {{ end }} + {{ else }} + <li>None</li> {{ end }} - {{ else }} - <li class="categories"> - <ul> - <li>None</li> - </ul> - </li> - {{ end }} - {{ if isset .Params "tags" }} - {{ $tagsLen := len .Params.tags }} - {{ if gt $tagsLen 0 }} - <li class="tags"> - <ul> - {{ range $k, $v := .Params.tags }} - {{ $url := printf "tags/%s" (. | urlize | lower) }} - <li><a class="article-category-link" href="{{ $url | absLangURL }}">{{ . }}</a></li> - {{ end }} - </ul> - </li> + </ul> + </li> + <li class="tags"> + <ul> + {{ if isset .Params "tags" }} + {{ if gt (len .Params.tags) 0 }} + {{ range .Params.tags }} + <li><a class="article-terms-link" href="{{ path.Join "tags" (. | urlize | lower) | relLangURL }}/">{{ . }}</a></li> + {{ end }} + {{ end }} + {{ else }} + <li>None</li> {{ end }} - {{ else }} - <li class="tags"> - <ul> - <li>None</li> - </ul> - </li> - {{ end }} + </ul> + </li> </ul> diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html new file mode 100644 index 0000000..adbba4f --- /dev/null +++ b/layouts/_default/terms.html @@ -0,0 +1,17 @@ +{{ define "main" }} + <ul class="posts"> + <header> + <h1>{{ i18n .Data.Plural }}</h1> + </header> + {{ range .Data.Terms.ByCount }} + <li> + <article> + <header> + <a href="{{ .Page.Permalink | relLangURL }}">{{ .Page.Title }}<span style="float:right;">{{ .Count }}</span></a> + </header> + </article> + </li> + {{ end }} + </ul> + {{ $.Scratch.Set "showCategories" false }} +{{ end }} diff --git a/layouts/partials/footer-category.html b/layouts/partials/footer-category.html deleted file mode 100644 index 83abe4f..0000000 --- a/layouts/partials/footer-category.html +++ /dev/null @@ -1,44 +0,0 @@ -<ul class="stats"> - {{ if isset .Params "categories" }} - {{ $categoryCount := (len .Params.sidebar.categories) }} - - <!-- - Set the title before displaying the categories associated with this post. - The title will use the variables from the Categories menu set in the Config. - If the Categories menu was not set then use the default values instead. - --> - {{ if ge $categoryCount 1 }} - <li> - {{ $categoryMenu := (where .Site.Menus.main "Name" "Categories") }} - {{ if ne (len $categoryMenu) 0 }} - {{ $categoryMenu := index $categoryMenu 0 }} - - {{ $.Scratch.Set "categoryUrl" $categoryMenu.URL }} - - {{ with $categoryMenu.Identifier }} - <i class="{{ . }}"> </i> - {{ end }} - - {{ if gt $categoryCount 1 }} - {{ $categoryMenu.Name }} - {{ else }} - {{ $categoryMenu.Name | singularize }} - {{ end }} - {{ else }} - {{ $.Scratch.Set "categoryUrl" "/categories/" }} - - {{ if gt $categoryCount 1 }} - {{ i18n "categories" }} - {{ else }} - {{ i18n "category" }} - {{ end }} - {{ end }} - </li> - {{ end }} - {{ end }} - - <!-- Display the categories associated with this post --> - {{ range .Params.sidebar.categories }} - <li><a href="{{ add ($.Scratch.Get "categoryUrl") . | urlize | relLangURL }}" lang="{{ $.Lang }}">{{ . }}</a></li> - {{ end }} -</ul> diff --git a/layouts/taxonomy/category.html b/layouts/taxonomy/category.html deleted file mode 100644 index e2e9df4..0000000 --- a/layouts/taxonomy/category.html +++ /dev/null @@ -1,21 +0,0 @@ -<!doctype html> -<html lang="{{ .Page.Language | default "en" }}"> - {{ partial "head" . }} - <body> - {{ partial "site-header" . }} - <div id="wrapper"> - {{ partial "site-intro" . }} - <main id="site-main"> - <h1>{{ .Title }}</h1> - {{ $paginator := .Paginate (where .Data.Pages "Type" "in" site.Params.mainSections) }} - {{ range $paginator.Pages }} - {{ .Render "content-list" }} - {{ end }} - {{ partial "pagination" . }} - </main> - {{ partial "site-sidebar" . }} - {{ partial "site-footer" . }} - {{ partial "scripts" . }} - </div> - </body> -</html> diff --git a/layouts/taxonomy/category.terms.html b/layouts/taxonomy/category.terms.html deleted file mode 100644 index 0e34701..0000000 --- a/layouts/taxonomy/category.terms.html +++ /dev/null @@ -1,40 +0,0 @@ -<!doctype html> -<html lang="{{ .Page.Language | default "en" }}"> - {{ partial "head" . }} - <body> - {{ partial "site-header" . }} - <div id="wrapper"> - {{ partial "site-intro" . }} - <main id="site-main"> - {{ if .Site.Params.categoriesByCount }} - {{ $.Scratch.Set "categories" .Data.Terms.ByCount }} - {{ else }} - {{ $.Scratch.Set "categories" .Data.Terms.Alphabetical }} - {{ end }} - <ul class="posts"> - <header> - <h1>{{ i18n .Data.Plural }}</h1> - </header> - {{ $data := .Data }} - {{ range $key, $value := $.Scratch.Get "categories" }} - <li> - <article> - <header> - {{ if ne $value.Name "" }} - <a href="{{ printf "/%s/%s" $data.Plural $value.Name | urlize | relLangURL }}">{{ $value.Name }}<span style="float:right;">{{ $value.Count }}</span></a> - {{ else }} - {{ i18n "uncategorized" }}<span style="float:right;">{{ $value.Count }}</span> - {{ end }} - </header> - </article> - </li> - {{ end }} - </ul> - </main> - {{ $.Scratch.Set "showCategories" false }} - {{ partial "site-sidebar" . }} - {{ partial "site-footer" . }} - {{ partial "scripts" . }} - </div> - </body> -</html> diff --git a/layouts/taxonomy/tag.html b/layouts/taxonomy/tag.html deleted file mode 100644 index e2e9df4..0000000 --- a/layouts/taxonomy/tag.html +++ /dev/null @@ -1,21 +0,0 @@ -<!doctype html> -<html lang="{{ .Page.Language | default "en" }}"> - {{ partial "head" . }} - <body> - {{ partial "site-header" . }} - <div id="wrapper"> - {{ partial "site-intro" . }} - <main id="site-main"> - <h1>{{ .Title }}</h1> - {{ $paginator := .Paginate (where .Data.Pages "Type" "in" site.Params.mainSections) }} - {{ range $paginator.Pages }} - {{ .Render "content-list" }} - {{ end }} - {{ partial "pagination" . }} - </main> - {{ partial "site-sidebar" . }} - {{ partial "site-footer" . }} - {{ partial "scripts" . }} - </div> - </body> -</html> diff --git a/layouts/taxonomy/tag.terms.html b/layouts/taxonomy/tag.terms.html deleted file mode 100644 index df7a44d..0000000 --- a/layouts/taxonomy/tag.terms.html +++ /dev/null @@ -1,40 +0,0 @@ -<!doctype html> -<html lang="{{ .Page.Language | default "en" }}"> - {{ partial "head" . }} - <body> - {{ partial "site-header" . }} - <div id="wrapper"> - {{ partial "site-intro" . }} - <main id="site-main"> - {{ if .Site.Params.tagsByCount }} - {{ $.Scratch.Set "tags" .Data.Terms.ByCount }} - {{ else }} - {{ $.Scratch.Set "tags" .Data.Terms.Alphabetical }} - {{ end }} - <ul class="posts"> - <header> - <h1>{{ i18n .Data.Plural }}</h1> - </header> - {{ $data := .Data }} - {{ range $key, $value := $.Scratch.Get "tags" }} - <li> - <article> - <header> - {{ if ne $value.Name "" }} - <a href="{{ printf "/%s/%s" $data.Plural $value.Name | urlize | relLangURL }}">{{ $value.Name }}<span style="float:right;">{{ $value.Count }}</span></a> - {{ else }} - {{ i18n "uncategorized" }}<span style="float:right;">{{ $value.Count }}</span> - {{ end }} - </header> - </article> - </li> - {{ end }} - </ul> - </main> - {{ $.Scratch.Set "showCategories" false }} - {{ partial "site-sidebar" . }} - {{ partial "site-footer" . }} - {{ partial "scripts" . }} - </div> - </body> -</html> |