Merge pull request #39 from CaiJimmy/new-archive-widget

feat: new archive widget style
This commit is contained in:
Jimmy Cai 2020-10-17 10:43:55 +02:00 committed by GitHub
commit f7b61b9556
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 30 deletions

View File

@ -36,27 +36,26 @@
/* Archives widget */ /* Archives widget */
.widget.archives { .widget.archives {
.archives-year { .widget-archive--list {
margin-bottom: 10px;
a {
background-color: var(--card-background);
padding: 15px 25px;
border-radius: var(--card-border-radius); border-radius: var(--card-border-radius);
box-shadow: var(--shadow-l1); box-shadow: var(--shadow-l1);
display: flex; background-color: var(--card-background);
transition: box-shadow 0.3s ease;
&:hover {
box-shadow: var(--shadow-l2);
} }
@media (max-width: $on-desktop-large) { .archives-year {
&:not(:last-of-type) {
border-bottom: 1.5px solid var(--card-separator-color);
}
a {
font-size: 1.4rem; font-size: 1.4rem;
} padding: 18px 25px;
display: flex;
span.year { span.year {
flex: 1; flex: 1;
color: var(--card-text-color-main); color: var(--card-text-color-main);
font-weight: bold;
} }
span.count { span.count {

View File

@ -15,5 +15,5 @@
{{ end }} {{ end }}
{{ define "right-sidebar" }} {{ define "right-sidebar" }}
{{ partialCached "sidebar/right.html" . }} {{ partial "sidebar/right.html" . }}
{{ end }} {{ end }}

View File

@ -9,6 +9,7 @@
{{ $filtered := ($pages | intersect $notHidden) }} {{ $filtered := ($pages | intersect $notHidden) }}
{{ $archives := $filtered.GroupByDate "2006" }} {{ $archives := $filtered.GroupByDate "2006" }}
<div class="widget-archive--list">
{{ range $index, $item := first (add .Site.Params.widgets.archives.limit 1) ($archives) }} {{ range $index, $item := first (add .Site.Params.widgets.archives.limit 1) ($archives) }}
{{- $id := lower (replace $item.Key " " "-") -}} {{- $id := lower (replace $item.Key " " "-") -}}
<div class="archives-year"> <div class="archives-year">
@ -22,4 +23,5 @@
</a> </a>
</div> </div>
{{ end }} {{ end }}
</div>
</section> </section>