Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions i18n/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,23 @@ other = "Was this page helpful?"
other = "Yes"
[feedback_negative]
other = "No"

# Taxonomy
[taxonomy_category]
other = "Category"
[taxonomy_categories]
other = "Categories"
[taxonomy_collection]
other = "Collection"
[taxonomy_collections]
other = "Collections"
[taxonomy_tag]
other = "Tag"
[taxonomy_tags]
other = "Tags"
[taxonomy_project]
other = "Project"
[taxonomy_projects]
other = "Projects"
[taxonomy_series]
other = "Series"
20 changes: 20 additions & 0 deletions i18n/zh-cn.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,23 @@ other = "这个页面对您有帮助吗?"
other = "有帮助"
[feedback_negative]
other = "没帮助"

# Taxonomy
[taxonomy_category]
other = "分类"
[taxonomy_categories]
other = "分类"
[taxonomy_collection]
other = "合集"
[taxonomy_collections]
other = "合集"
[taxonomy_tag]
other = "标签"
[taxonomy_tags]
other = "标签"
[taxonomy_project]
other = "项目"
[taxonomy_projects]
other = "项目"
[taxonomy_series]
other = "系列"
20 changes: 20 additions & 0 deletions i18n/zh-tw.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,23 @@ other = "這個頁面對您有幫助嗎?"
other = "有幫助"
[feedback_negative]
other = "沒幫助"

# Taxonomy
[taxonomy_category]
other = "分類"
[taxonomy_categories]
other = "分類"
[taxonomy_collection]
other = "合集"
[taxonomy_collections]
other = "合集"
[taxonomy_tag]
other = "標籤"
[taxonomy_tags]
other = "標籤"
[taxonomy_project]
other = "專案"
[taxonomy_projects]
other = "專案"
[taxonomy_series]
other = "系列"
3 changes: 2 additions & 1 deletion layouts/_partials/taxonomy_terms_article.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
{{ $taxo := .taxo -}}
{{ if (gt (len ($context.GetTerms $taxo)) 0) -}}
<div class="taxonomy taxonomy-terms-article taxo-{{ urlize $taxo }}">
<h5 class="taxonomy-title">{{ humanize $taxo }}:</h5>
{{ $title := partial "taxonomy_title.html" (dict "context" $context "taxo" $taxo) }}
<h5 class="taxonomy-title">{{ $title }}:</h5>
<ul class="taxonomy-terms">
{{ range ($context.GetTerms $taxo) -}}
<li><a class="taxonomy-term" href="{{ .Permalink }}" data-taxonomy-term="{{ urlize .LinkTitle }}"><span class="taxonomy-label">{{ .LinkTitle }}</span></a></li>
Expand Down
19 changes: 14 additions & 5 deletions layouts/_partials/taxonomy_terms_clouds.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
{{ $context := . -}}

{{ if .Site.Params.taxonomy -}}
{{ if .Site.Params.Taxonomy.taxonomyCloud -}}
{{ range $index, $taxo := .Site.Params.Taxonomy.taxonomyCloud -}}
{{ if $.Site.Params.Taxonomy.taxonomyCloudTitle -}}
{{ $.Scratch.Set "title" (index $.Site.Params.Taxonomy.taxonomyCloudTitle $index) -}}
{{ else -}}
{{ $.Scratch.Set "title" (humanize $taxo) -}}
{{ end -}}

{{ $title := (humanize $taxo) }}
{{ with (index $.Site.Params.Taxonomy.taxonomyCloudTitleMap $taxo) }}
{{ $title = . }}
{{ else }}
{{ with $.Site.Params.Taxonomy.taxonomyCloudTitle }}
{{ if lt $index (len .) }}
{{ $title = (index . $index) }}
{{ end }}
{{ end }}
{{ end }}
{{ $.Scratch.Set "title" $title }}

{{ partial "taxonomy_terms_cloud.html" (dict "context" $context "taxo" $taxo "title" ($.Scratch.Get "title")) -}}
{{ end }}
{{ else -}}
Expand Down
14 changes: 14 additions & 0 deletions layouts/_partials/taxonomy_title.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{ $context := .context }}
{{ $taxo := (lower .taxo) }}
{{ $title := (humanize $taxo) }}

{{ with (index $context.Site.Params.Taxonomy.taxonomyAliasMap $taxo) }}
{{ $title = . }}
{{ else }}
{{ $i18nKey := printf "taxonomy_%s" $taxo }}
{{ with T $i18nKey }}
{{ $title = . }}
{{ end }}
{{ end }}

{{- $title -}}
2 changes: 1 addition & 1 deletion layouts/taxonomy.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ define "main" -}}
<div class="td-content">
<main class="taxonomy-terms-page">
<h1>{{ .Title }}</h1>
<h1>{{ default .Title (partial "taxonomy_title.html" (dict "context" . "taxo" (lower .Title))) }}</h1>
{{ partial "taxonomy_terms_cloud.html" (dict "context" . "taxo" ( lower .Title ) ) -}}
</main>
</div>
Expand Down
8 changes: 6 additions & 2 deletions layouts/term.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{{ define "main" -}}
<div class="td-content">
<main class="taxonomy-taxonomy-page">
<h1>{{ with .Data.Singular }}{{ . | humanize }}: {{ end }}<span>{{ .Title }}</span></h1>

{{ $singular := partial "taxonomy_title.html" (dict "context" . "taxo" .Data.Singular) }}
{{ $plural := partial "taxonomy_title.html" (dict "context" . "taxo" .Data.Plural) }}

<h1>{{ $singular }}: <span>{{ .Title }}</span></h1>
<div>
{{ .Content }}
</div>
Expand All @@ -26,7 +30,7 @@ <h3><a href="{{ $manualLink }}"{{ with .Params.manualLinkTitle }} title="{{ . }}
</article>
{{ end }}
</div>
<a href="{{ with .Site.GetPage (printf "/%s" ( lower .Data.Plural )) }}{{ .Permalink }}{{ end }}" class="all-taxonomy-terms">{{ humanize ( T "ui_all" ) }} {{ with .Data.Plural }}{{ . | humanize }}{{ end }}</a>
<a href="{{ with .Site.GetPage (printf "/%s" ( lower .Data.Plural )) }}{{ .Permalink }}{{ end }}" class="all-taxonomy-terms">{{ humanize ( T "ui_all" ) }} {{ $plural }}</a>
</main>
</div>
{{- end }}
Loading