mirror of
https://github.com/thomasjsn/hugo-theme-hello-friend.git
synced 2024-11-14 12:25:07 +01:00
Change terms page
This commit is contained in:
parent
d85cdb04b3
commit
03d4390fa9
@ -1,18 +1,18 @@
|
||||
{{ define "main" }}
|
||||
|
||||
<div class="archive">
|
||||
<h1>{{ .Title }}</h1>
|
||||
<ul>
|
||||
{{ $type := .Type }}
|
||||
{{ range $key, $value := .Data.Terms.Alphabetical }}
|
||||
{{ $name := .Name }}
|
||||
{{ $count := .Count }}
|
||||
{{ with $.Site.GetPage (printf "/%s/%s" $type $name) }}
|
||||
<h3 class="archive__post-title">
|
||||
<a href="{{ .Permalink }}">{{ .Name }} ({{ $count }})</a>
|
||||
</h3>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
<div class="terms">
|
||||
<h1>{{ .Title }}</h1>
|
||||
<ul class="terms__list">
|
||||
{{ $type := .Type }}
|
||||
{{ range $key, $value := .Data.Terms.Alphabetical }}
|
||||
{{ $name := .Name }}
|
||||
{{ $count := .Count }}
|
||||
{{ with $.Site.GetPage (printf "/%s/%s" $type $name) }}
|
||||
<li class="terms__term">
|
||||
<a href="{{ .Permalink }}">#{{ .Name }} <span class="terms__term-count">{{ $count }}</span></a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
@ -10,6 +10,7 @@
|
||||
@import 'pagination';
|
||||
@import 'footer';
|
||||
|
||||
@import 'terms';
|
||||
@import 'archive';
|
||||
|
||||
@import 'prism';
|
||||
|
34
source/css/terms.css
Normal file
34
source/css/terms.css
Normal file
@ -0,0 +1,34 @@
|
||||
.terms {
|
||||
width: 100%;
|
||||
max-width: 800px;
|
||||
text-align: left;
|
||||
padding: 20px;
|
||||
margin: 0 auto;
|
||||
|
||||
&__list {
|
||||
padding: 0;
|
||||
padding-left: 20px;
|
||||
margin: 0;
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
&__term {
|
||||
margin-bottom: 15px;
|
||||
|
||||
&-count {
|
||||
background: var(--light-background-secondary);
|
||||
font-size: 12px;
|
||||
margin-left: 5px;
|
||||
padding: 2px 10px;
|
||||
border-radius: 5px;
|
||||
text-decoration: none;
|
||||
|
||||
.dark-theme & {
|
||||
background: var(--dark-background-secondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user