Use details summary for related articles
This commit is contained in:
parent
c61a9ddb9f
commit
9b39f6443e
|
@ -697,15 +697,6 @@ select {
|
|||
.mentions-list {
|
||||
margin-top: 5px;
|
||||
list-style: none;
|
||||
.item {
|
||||
.link {
|
||||
.post-title {
|
||||
margin-bottom: 0;
|
||||
overflow: hidden;
|
||||
font-size: .8125rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -815,23 +806,13 @@ select {
|
|||
text-align: center;
|
||||
}
|
||||
.caption {
|
||||
display: block;
|
||||
margin-bottom: 5px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.related-list {
|
||||
margin-top: 5px;
|
||||
list-style: none;
|
||||
.item {
|
||||
.link {
|
||||
.post-title {
|
||||
margin-bottom: 0;
|
||||
overflow: hidden;
|
||||
font-size: .8125rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
{{ $related := .Site.RegularPages.Related . | first 5 }}
|
||||
{{ with $related }}
|
||||
<div class="related">
|
||||
<span class="caption">{{ T "related" }}</span>
|
||||
<ul class="related-list">
|
||||
{{ range . }}
|
||||
<li class="item"><a class="link" href="{{ .RelPermalink }}"><p class="post-title">
|
||||
{{ with .Title }}{{ . }}{{ else }}{{ .Summary | truncate 60 }}{{ end }}
|
||||
</p></a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
<details>
|
||||
<summary class="caption">{{ T "related" }}</summary>
|
||||
<ul class="related-list">
|
||||
{{ range . }}
|
||||
<li class="item">
|
||||
<a class="link" href="{{ .RelPermalink }}">{{ with .Title }}{{ . }}{{ else }}{{ .Summary | truncate 60 }}{{ end }}</a> <i>{{.Date.Format ( .Site.Params.dateformat | default "January 02, 2006")}}</i>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</details>
|
||||
</div>
|
||||
{{ end }}
|
Reference in New Issue