mirror of
https://github.com/13hannes11/hugo-coder-timeline.git
synced 2024-09-04 00:50:58 +02:00
Taxonomies list as a tag cloud (#557)
* Taxonomies list as a tag cloud * Generate resources for demo preview
This commit is contained in:
committed by
GitHub
parent
67f278f1b4
commit
af7360e89a
@@ -65,6 +65,23 @@
|
|||||||
margin-right: 1.5rem;
|
margin-right: 1.5rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tags {
|
||||||
|
.tag {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0.3rem 0.6rem;
|
||||||
|
background-color: $alt-bg-color;
|
||||||
|
border-radius: 0.6rem;
|
||||||
|
line-height: 1.4em;
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: $fg-color;
|
||||||
|
}
|
||||||
|
a:active {
|
||||||
|
color: $fg-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,19 @@
|
|||||||
@mixin content_dark {
|
@mixin content_dark {
|
||||||
.content {
|
.content {
|
||||||
|
.post {
|
||||||
|
.tags {
|
||||||
|
.tag {
|
||||||
|
background-color: $alt-bg-color-dark;
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: $fg-color-dark;
|
||||||
|
}
|
||||||
|
a:active {
|
||||||
|
color: $fg-color-dark;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
.list {
|
.list {
|
||||||
ul {
|
ul {
|
||||||
li {
|
li {
|
||||||
|
|||||||
20
assets/scss/_taxonomies.scss
Normal file
20
assets/scss/_taxonomies.scss
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
.taxonomy {
|
||||||
|
li {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.taxonomy-element {
|
||||||
|
display: block;
|
||||||
|
padding: 0.3rem 0.9rem;
|
||||||
|
background-color: $alt-bg-color;
|
||||||
|
border-radius: 0.6rem;
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: $fg-color;
|
||||||
|
}
|
||||||
|
a:active {
|
||||||
|
color: $fg-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
assets/scss/_taxonomies_dark.scss
Normal file
12
assets/scss/_taxonomies_dark.scss
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
.taxonomy {
|
||||||
|
.taxonomy-element {
|
||||||
|
background-color: $alt-bg-color-dark;
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: $fg-color-dark;
|
||||||
|
}
|
||||||
|
a:active {
|
||||||
|
color: $fg-color-dark;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,5 +3,6 @@
|
|||||||
@import "content_dark";
|
@import "content_dark";
|
||||||
@import "notices_dark";
|
@import "notices_dark";
|
||||||
@import "navigation_dark";
|
@import "navigation_dark";
|
||||||
|
@import "taxonomies_dark";
|
||||||
@import "footer_dark";
|
@import "footer_dark";
|
||||||
@import "float_dark";
|
@import "float_dark";
|
||||||
|
|||||||
@@ -5,5 +5,6 @@
|
|||||||
@import "notices";
|
@import "notices";
|
||||||
@import "navigation";
|
@import "navigation";
|
||||||
@import "pagination";
|
@import "pagination";
|
||||||
|
@import "taxonomies";
|
||||||
@import "footer";
|
@import "footer";
|
||||||
@import "float";
|
@import "float";
|
||||||
|
|||||||
11
layouts/_default/terms.html
Normal file
11
layouts/_default/terms.html
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{{ define "title" }}
|
||||||
|
{{- if eq .Kind "term" -}}
|
||||||
|
{{- i18n .Data.Singular | title -}}
|
||||||
|
{{- print ": " -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- .Title }} · {{ .Site.Title -}}
|
||||||
|
{{ end }}
|
||||||
|
{{ define "content" }}
|
||||||
|
{{ partial "terms.html" . }}
|
||||||
|
{{ end }}
|
||||||
@@ -4,6 +4,8 @@
|
|||||||
{{- if gt $index 0 }}
|
{{- if gt $index 0 }}
|
||||||
<span class="separator">•</span>
|
<span class="separator">•</span>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<a href="{{ ( printf "tags/%s/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
|
<span class="tag">
|
||||||
|
<a href="{{ ( printf "tags/%s/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
|
||||||
|
</span>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
28
layouts/partials/terms.html
Normal file
28
layouts/partials/terms.html
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<section class="container taxonomy">
|
||||||
|
<h1 class="title">
|
||||||
|
<a class="title-link" href="{{ .Permalink | safeURL }}">
|
||||||
|
{{- if eq .Kind "term" -}}
|
||||||
|
{{- i18n .Data.Singular | title -}}
|
||||||
|
{{- print ": " -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- i18n (lower .Title) | default .Title | title -}}
|
||||||
|
</a>
|
||||||
|
</h1>
|
||||||
|
{{ .Content }}
|
||||||
|
<ul>
|
||||||
|
{{ $type := .Type }}
|
||||||
|
{{ range $key, $value := .Data.Terms.Alphabetical }}
|
||||||
|
{{ $name := .Name }}
|
||||||
|
{{ $count := .Count }}
|
||||||
|
{{ with $.Site.GetPage (printf "/%s/%s" $type $name) }}
|
||||||
|
<li>
|
||||||
|
<span class="taxonomy-element">
|
||||||
|
<a href="{{ .Permalink }}">{{ .Name }}</a>
|
||||||
|
<sup>{{ $count }}</sup>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
|||||||
{"Target":"css/coder-dark.min.dde8a61eb31a32353b4baf3d9113f03c4ea2a8ca9bb736f59ca2d2b2cb664f0b.css","MediaType":"text/css","Data":{"Integrity":"sha256-3eimHrMaMjU7S689kRPwPE6iqMqbtzb1nKLSsstmTws="}}
|
{"Target":"css/coder-dark.min.f37febc669ce189201c1918fac1948a254686c8d366a312c2d72b2bb71ad97d1.css","MediaType":"text/css","Data":{"Integrity":"sha256-83/rxmnOGJIBwZGPrBlIolRobI02ajEsLXKyu3Gtl9E="}}
|
||||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
|||||||
{"Target":"css/coder.min.eb7743f94930acfd17146aecc1f80e86fe35b3e451f2ec0c98485f9c4d962f34.css","MediaType":"text/css","Data":{"Integrity":"sha256-63dD+UkwrP0XFGrswfgOhv41s+RR8uwMmEhfnE2WLzQ="}}
|
{"Target":"css/coder.min.6eb8a4b05d07103972815bdff1a2f4316a597e727e92f3eea14edff80a8451b5.css","MediaType":"text/css","Data":{"Integrity":"sha256-briksF0HEDlygVvf8aL0MWpZfnJ+kvPuoU7f+AqEUbU="}}
|
||||||
Reference in New Issue
Block a user