Skip to content

Commit

Permalink
chore: rename taxonomicOrder to sidebarTaxonomies
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Jan 9, 2022
1 parent c5948b8 commit 42c840d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion exampleSite/config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ googleAdsense = ""
taxonomyPostCount = 20 # The number of taxonomy's posts. Turn off by setting it to false.
countTaxonomyPosts = true # Count posts of taxonomy.

# taxonomicOrder = ["categories", "tags", "series"] # The order of taxonomies on the sidebar.
# sidebarTaxonomies = ["categories", "tags", "series"] # The order of taxonomies on the sidebar.

# pinnedPost = false # Turn on/off pinned posts.
pinnedPostCount = 3 # The number of pinned posts.
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/docs/configuration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ See also [All Configuration Settings](https://gohugo.io/getting-started/configur
| `taxonomyPaginate` | Integer | `10` |
| `taxonomyPostCount` | Integer | `3` | The number of taxonomy's posts. Turn off by setting it to false.
| `countTaxonomyPosts` | Boolean | `false` | Count posts of taxonomy.
| `taxonomicOrder` | Array | `["series", "categories", "tags"]` | The order of taxonomies on the sidebar.
| `sidebarTaxonomies` | Array | `["series", "categories", "tags"]` | The taxonomies on the sidebar.
| `fullWidth` | Boolean | `false` | Full width.
| `fixedHeader` | Boolean | `true` | Turn on/off fixed header.
| `reward` | Object | - | [Reward Widget]({{< ref "/docs/widgets/reward" >}}), AKA Buy Me a Coffee Widget.
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/docs/configuration/index.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ aliases = [
| `taxonomyPaginate` | Integer | `10` |
| `taxonomyPostCount` | Integer | `3` | 分类的列表文章数,`false` 则隐藏。
| `countTaxonomyPosts` | Boolean | `false` | 显示分类的文章总数。
| `taxonomicOrder` | Array | `["series", "categories", "tags"]` | 侧边栏的分类顺序
| `sidebarTaxonomies` | Array | `["series", "categories", "tags"]` | 侧边栏的分类
| `fullWidth` | Boolean | `false` | 是否全宽
| `fixedHeader` | Boolean | `true` | 是否固定头部
| `reward` | Object | - | [打赏小部件]({{< ref "/docs/widgets/reward" >}}),又称 Buy Me a Coffee 小部件。
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/docs/configuration/index.zh-tw.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ aliases = [
| `taxonomyPaginate` | Integer | `10` |
| `taxonomyPostCount` | Integer | `3` | 分類的列表文章數,`false` 則隱藏。
| `countTaxonomyPosts` | Boolean | `false` | 是否顯示分類的文章總數。
| `taxonomicOrder` | Array | `["series", "categories", "tags"]` | 側邊欄的分類順序
| `sidebarTaxonomies` | Array | `["series", "categories", "tags"]` | 側邊欄的分類
| `fullWidth` | Boolean | `false` | 是否全寬
| `fixedHeader` | Boolean | `true` | 是否固定頭部
| `reward` | Object | - | [打賞小部件]({{< ref "/docs/widgets/reward" >}}),又稱 Buy Me a Coffee 小部件。
Expand Down
7 changes: 1 addition & 6 deletions layouts/partials/sidebar/taxonomies.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{{- $order := default (slice "series" "categories" "tags") $.Site.Params.taxonomicOrder -}}
{{- range $key, $value := $.Site.Taxonomies -}}
{{- if not (in $order $key) -}}
{{- $order = $order | append $key -}}
{{- end -}}
{{- end -}}
{{- $order := default (slice "series" "categories" "tags") $.Site.Params.sidebarTaxonomies -}}
{{- range $expected := $order -}}
{{- range $key, $value := $.Site.Taxonomies -}}
{{- if eq $key $expected -}}
Expand Down

0 comments on commit 42c840d

Please sign in to comment.