Merge pull request #39 from CaiJimmy/new-archive-widget
feat: new archive widget style
This commit is contained in:
commit
f7b61b9556
@ -36,27 +36,26 @@
|
|||||||
|
|
||||||
/* Archives widget */
|
/* Archives widget */
|
||||||
.widget.archives {
|
.widget.archives {
|
||||||
|
.widget-archive--list {
|
||||||
|
border-radius: var(--card-border-radius);
|
||||||
|
box-shadow: var(--shadow-l1);
|
||||||
|
background-color: var(--card-background);
|
||||||
|
}
|
||||||
|
|
||||||
.archives-year {
|
.archives-year {
|
||||||
margin-bottom: 10px;
|
&:not(:last-of-type) {
|
||||||
|
border-bottom: 1.5px solid var(--card-separator-color);
|
||||||
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
background-color: var(--card-background);
|
font-size: 1.4rem;
|
||||||
padding: 15px 25px;
|
padding: 18px 25px;
|
||||||
border-radius: var(--card-border-radius);
|
|
||||||
box-shadow: var(--shadow-l1);
|
|
||||||
display: flex;
|
display: flex;
|
||||||
transition: box-shadow 0.3s ease;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
box-shadow: var(--shadow-l2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: $on-desktop-large) {
|
|
||||||
font-size: 1.4rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
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 {
|
||||||
|
@ -15,5 +15,5 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ define "right-sidebar" }}
|
{{ define "right-sidebar" }}
|
||||||
{{ partialCached "sidebar/right.html" . }}
|
{{ partial "sidebar/right.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
@ -9,17 +9,19 @@
|
|||||||
{{ $filtered := ($pages | intersect $notHidden) }}
|
{{ $filtered := ($pages | intersect $notHidden) }}
|
||||||
{{ $archives := $filtered.GroupByDate "2006" }}
|
{{ $archives := $filtered.GroupByDate "2006" }}
|
||||||
|
|
||||||
{{ range $index, $item := first (add .Site.Params.widgets.archives.limit 1) ($archives) }}
|
<div class="widget-archive--list">
|
||||||
{{- $id := lower (replace $item.Key " " "-") -}}
|
{{ range $index, $item := first (add .Site.Params.widgets.archives.limit 1) ($archives) }}
|
||||||
<div class="archives-year">
|
{{- $id := lower (replace $item.Key " " "-") -}}
|
||||||
<a href="{{ $.Site.Params.widgets.archives.path | relLangURL }}#{{ $id }}">
|
<div class="archives-year">
|
||||||
{{ if eq $index $.Site.Params.widgets.archives.limit }}
|
<a href="{{ $.Site.Params.widgets.archives.path | relLangURL }}#{{ $id }}">
|
||||||
<span class="year">{{ T "widgetArchivesMore" }}</span>
|
{{ if eq $index $.Site.Params.widgets.archives.limit }}
|
||||||
{{ else }}
|
<span class="year">{{ T "widgetArchivesMore" }}</span>
|
||||||
<span class="year">{{ .Key }}</span>
|
{{ else }}
|
||||||
<span class="count">{{ len $item.Pages }}</span>
|
<span class="year">{{ .Key }}</span>
|
||||||
{{ end }}
|
<span class="count">{{ len $item.Pages }}</span>
|
||||||
</a>
|
{{ end }}
|
||||||
</div>
|
</a>
|
||||||
{{ end }}
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
Loading…
Reference in New Issue
Block a user