aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorolOwOlo <26087907+olOwOlo@users.noreply.github.com>2018-11-06 16:07:46 +0800
committerolOwOlo <26087907+olOwOlo@users.noreply.github.com>2018-11-06 16:07:46 +0800
commit7f314ceecd2df405950419f6cc2ca2dc18d23cd4 (patch)
treef478e8791db34dcb05b98affd8396fb371f9ea6b
parent8d390991f895e079e21f5d1c550e0736a29e8cea (diff)
refactor(terms): remove tags and categories class
-rw-r--r--layouts/_default/terms.html20
-rw-r--r--src/css/_partial/_categories.scss43
-rw-r--r--src/css/_partial/_post/_admonition.scss2
-rw-r--r--src/css/_partial/_terms.scss (renamed from src/css/_partial/_tags.scss)20
-rw-r--r--src/css/_variables.scss30
-rw-r--r--src/css/style.scss3
6 files changed, 30 insertions, 88 deletions
diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html
index 08498f6..abbc170 100644
--- a/layouts/_default/terms.html
+++ b/layouts/_default/terms.html
@@ -5,37 +5,37 @@
{{ $terms := .Data.Terms.ByCount -}}
{{ $length := len $terms -}}
{{ if eq $name "categories" -}}
- <div class="categories">
- <div class="categories-title">
+ <div class="terms">
+ <div class="terms-title">
{{ if eq $length 0 -}}
{{ T "zeroCategoryCounter" }}
{{- else -}}
{{ T "categoryCounter" $length }}
{{- end }}
</div>
- <div class="categories-tags">
+ <div class="terms-tags">
{{ range $key, $value := $terms -}}
- <a class="category-link" href="{{ $name | relLangURL }}/{{ $value.Term | urlize }}/">
+ <a class="terms-link" href="{{ $name | relLangURL }}/{{ $value.Term | urlize }}/">
{{ $value.Term }}
- <span class="category-count">{{ len $value.Pages }}</span>
+ <span class="terms-count">{{ len $value.Pages }}</span>
</a>
{{ end -}}
</div>
</div>
{{- else if eq $name "tags" -}}
- <div class="tag-cloud">
- <div class="tag-cloud-title">
+ <div class="terms">
+ <div class="terms-title">
{{ if eq $length 0 -}}
{{ T "zeroTagCounter" }}
{{- else -}}
{{ T "tagCounter" $length }}
{{- end }}
</div>
- <div class="tag-cloud-tags">
+ <div class="terms-tags">
{{- range $key, $value := $terms }}
- <a href="{{ $name | relLangURL }}/{{ $value.Term | urlize }}/">
+ <a class="terms-link" href="{{ $name | relLangURL }}/{{ $value.Term | urlize }}/">
{{ $value.Term }}
- <span class="tag-count">{{ len $value.Pages }}</span>
+ <span class="terms-count">{{ len $value.Pages }}</span>
</a>
{{ end -}}
</div>
diff --git a/src/css/_partial/_categories.scss b/src/css/_partial/_categories.scss
deleted file mode 100644
index f9c413d..0000000
--- a/src/css/_partial/_categories.scss
+++ /dev/null
@@ -1,43 +0,0 @@
-
-.categories {
- margin: 2em 0 3em;
- text-align: center;
- font-family: $global-serif-font-family;
-
- .categories-title {
- display: inline-block;
- font-size: $categories-title-size;
- color: $theme-color;
- border-bottom: $categories-title-border-bottom;
- }
-
- .categories-tags {
- margin: 10px 0;
-
- .category-link {
- display: inline-block;
- position: relative;
- margin: $categories-tags-link-margin;
- word-wrap: break-word;
- transition-duration: 0.2s;
- transition-property: transform;
- transition-timing-function: ease-out;
-
- .category-count {
- display: inline-block;
- position: relative;
- top: -8px;
- right: -2px;
- color: $theme-color;
- font-size: $category-count-font-size;
- }
-
- &:active,
- &:focus,
- &:hover {
- color: $theme-color;
- transform: scale(1.1);
- }
- }
- }
-} \ No newline at end of file
diff --git a/src/css/_partial/_post/_admonition.scss b/src/css/_partial/_post/_admonition.scss
index 99fdc5e..75444d6 100644
--- a/src/css/_partial/_post/_admonition.scss
+++ b/src/css/_partial/_post/_admonition.scss
@@ -1,5 +1,3 @@
-@import "../../iconfont";
-
.admonition {
box-shadow: 0 2px 2px 0 rgba(0,0,0,.14),
0 1px 5px 0 rgba(0,0,0,.12),
diff --git a/src/css/_partial/_tags.scss b/src/css/_partial/_terms.scss
index e32a90e..f498ffe 100644
--- a/src/css/_partial/_tags.scss
+++ b/src/css/_partial/_terms.scss
@@ -1,38 +1,38 @@
// ==============================
-// Tags
+// General Terms(tags, categories, etc.)
// =============================
-.tag-cloud {
+.terms {
margin: 2em 0 3em;
text-align: center;
font-family: $global-serif-font-family;
- .tag-cloud-title {
+ .terms-title {
display: inline-block;
- font-size: $tag-cloud-title-size;
+ font-size: $terms-title-size;
color: $theme-color;
- border-bottom: $tag-cloud-title-border-bottom;
+ border-bottom: $terms-title-border-bottom;
}
- .tag-cloud-tags {
+ .terms-tags {
margin: 10px 0;
- a {
+ .terms-link {
display: inline-block;
position: relative;
- margin: $tag-cloud-tags-link-margin;
+ margin: $terms-link-margin;
word-wrap: break-word;
transition-duration: 0.2s;
transition-property: transform;
transition-timing-function: ease-out;
- .tag-count {
+ .terms-count {
display: inline-block;
position: relative;
top: -8px;
right: -2px;
color: $theme-color;
- font-size: $category-count-font-size;
+ font-size: $terms-count-font-size;
}
&:active,
diff --git a/src/css/_variables.scss b/src/css/_variables.scss
index 9b7c166..c9d9765 100644
--- a/src/css/_variables.scss
+++ b/src/css/_variables.scss
@@ -312,27 +312,15 @@ $archive-post-hover-transition: 0.2s ease-out !default;
// Transform of the archive post when hover it.
$archive-post-hover-transform: translateX(4px) !default;
+// ========== General Terms ========== //
+// Font size of the terms title.
+$terms-title-size: 18px !default;
-// ========== Tags ========== //
-// Font soze of the tag cloud title.
-$tag-cloud-title-size: 18px !default;
+// Border bottom of the terms title.
+$terms-title-border-bottom: 2px solid $theme-color !default;
-// Border bottom of the tag cloud title.
-$tag-cloud-title-border-bottom: 2px solid $theme-color !default;
+// Margin of the terms link.
+$terms-link-margin: 5px 10px !default;
-// Margin of the tag cloud tags link.
-$tag-cloud-tags-link-margin: 5px 10px !default;
-
-
-// ========== Categories ========== //
-// Font soze of the categories title.
-$categories-title-size: 18px !default;
-
-// Border bottom of the categories title.
-$categories-title-border-bottom: 2px solid $theme-color !default;
-
-// Margin of the categories tags link.
-$categories-tags-link-margin: 5px 10px !default;
-
-// Font size of the category count
-$category-count-font-size: 12px !default;
+// Font size of the terms count
+$terms-count-font-size: 12px !default;
diff --git a/src/css/style.scss b/src/css/style.scss
index 50fcf7a..5bdac04 100644
--- a/src/css/style.scss
+++ b/src/css/style.scss
@@ -11,8 +11,7 @@
@import "_partial/pagination";
@import "_partial/footer";
@import "_partial/archive";
-@import "_partial/tags";
-@import "_partial/categories";
+@import "_partial/terms";
@import "_partial/slideout";
@import "_partial/mobile";
@import "_partial/back-to-top";