mirror of
https://git.adityakumar.xyz/hugo-theme-even.git
synced 2024-11-09 14:59:45 +00:00
refactor(terms): remove tags and categories class
This commit is contained in:
parent
8d390991f8
commit
7f314ceecd
6 changed files with 30 additions and 88 deletions
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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),
|
||||
|
|
|
@ -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,
|
|
@ -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;
|
||||
|
|
|
@ -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";
|
||||
|
|
Loading…
Reference in a new issue