Feat: add count badge for taxonomy (#122)

This commit is contained in:
Cell
2022-04-22 17:00:15 +08:00
parent ff0f60646e
commit 9dfa6ec837
5 changed files with 18 additions and 14 deletions
+7
View File
@@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
## v0.2.14
> Add hugo new features support.
- :recycle: Refactor: header layout
- :tada: Feat: add sub menu (nested menu) support ([#31](https://github.com/Lruihao/FixIt/issues/31))
- :sparkles: Feat: add user-defined content to menu items via the `params` field ([#99](https://github.com/Lruihao/FixIt/issues/99))
@@ -16,6 +18,7 @@ All notable changes to this project will be documented in this file.
- :sparkles: Feat: link shortcode add `external-icon` option ([#96](https://github.com/Lruihao/FixIt/issues/96))
- :sparkles: Feat: add GitHub Corners support ([#106](https://github.com/Lruihao/FixIt/issues/106))
- :sparkles: Feat: add "Edit this page" button support ([#103](https://github.com/Lruihao/FixIt/issues/103))
- :sparkles: Feat: add count badge for taxonomy ([#122](https://github.com/Lruihao/FixIt/issues/122))
- :bug: Fix: invalid front matter `comment: true` ([#108](https://github.com/Lruihao/FixIt/issues/108))
- :bug: Fix: ibruce and watermark option negative value error ([#114](https://github.com/Lruihao/FixIt/issues/114))
- :lipstick: Style: add some common CSS styles Class ([#101](https://github.com/Lruihao/FixIt/issues/101))
@@ -33,6 +36,8 @@ All notable changes to this project will be documented in this file.
## v0.2.13 [2022.3.14]
> Improve and add some new features.
- :recycle: Refactor: page layout ([#65](https://github.com/Lruihao/FixIt/issues/65))
- :tada: Feat: add Artalk comment support ([#54](https://github.com/Lruihao/FixIt/issues/54), @hiifong[#57](https://github.com/Lruihao/FixIt/pull/57))
- :tada: Feat: add Waline comment support ([#36](https://github.com/Lruihao/FixIt/issues/36))
@@ -66,6 +71,8 @@ All notable changes to this project will be documented in this file.
## v0.2.12 [2022-1-27]
> Fix most known bugs and add some new features.
- :tada: Feat: add PWA support
- :tada: Feat: add Watermark support ([#16](https://github.com/Lruihao/FixIt/issues/16))
- :tada: Feat: add "不蒜子" count and site run time ([#18](https://github.com/Lruihao/FixIt/issues/18))
-8
View File
@@ -1,14 +1,6 @@
.archive {
.single-title {
text-align: right;
sup {
color: $global-font-secondary-color;
[theme='dark'] & {
color: $global-font-secondary-color-dark;
}
}
}
.group-title {
+2 -2
View File
@@ -6,8 +6,8 @@
<div class="page archive">
{{- /* Title */ -}}
<h2 class="single-title animate__animated animate__pulse animate__faster">
{{- .Params.Title | default (T .Section) | default .Section | dict "Some" | T "allSome" -}}
&nbsp;<sup>{{- len .Pages -}}</sup>
{{- .Params.Title | default (T .Section) | default .Section | dict "Some" | T "allSome" }}
<sup>{{- len .Pages -}}</sup>
</h2>
{{- /* Paginate */ -}}
+5 -2
View File
@@ -7,10 +7,13 @@
{{- /* Title */ -}}
<h2 class="single-title animate__animated animate__pulse animate__faster">
{{- $taxonomy := .Data.Singular -}}
{{- $pageCount := len .Pages -}}
{{- if eq $taxonomy "category" -}}
<i class="far fa-folder-open fa-fw"></i>&nbsp;{{ .Title }}
<i class="far fa-folder-open fa-fw"></i>
{{ .Title }}&nbsp;<sup>{{- $pageCount -}}</sup>
{{- else if eq $taxonomy "tag" -}}
<i class="fas fa-tag fa-fw"></i>&nbsp;{{ .Title }}
<i class="fas fa-tag fa-fw"></i>
{{ .Title }}&nbsp;<sup>{{- $pageCount -}}</sup>
{{- else -}}
{{- printf "%v - %v" (T $taxonomy | default $taxonomy) .Title -}}
{{- end -}}
+4 -2
View File
@@ -10,7 +10,8 @@
<div class="page archive">
{{- /* Title */ -}}
<h2 class="single-title animate__animated animate__pulse animate__faster">
{{- .Params.Title | default (T $taxonomies) | default $taxonomies | dict "Some" | T "allSome" -}}
{{- .Params.Title | default (T $taxonomies) | default $taxonomies | dict "Some" | T "allSome" }}
<sup>{{- len $terms -}}</sup>
</h2>
{{- /* Categories Page */ -}}
@@ -24,7 +25,8 @@
<div class="card-item-wrapper">
<h3 class="card-item-title">
<a href="{{ .RelPermalink }}">
<i class="far fa-folder fa-fw"></i>&nbsp;{{ .Page.Title }}
<i class="far fa-folder fa-fw"></i>
{{ .Page.Title }}&nbsp;<sup>{{- len $pages -}}</sup>
</a>
</h3>
{{- range first 5 $pages -}}