mirror of
https://github.com/Vimux/Binario.git
synced 2024-11-21 13:48:29 +00:00
Add initial "related articles" block
This commit is contained in:
parent
216780dc4b
commit
5d3bea73a5
4 changed files with 21 additions and 0 deletions
|
@ -8,6 +8,10 @@
|
|||
- id: meta_categories
|
||||
translation: Categories
|
||||
|
||||
# Related
|
||||
- id: related_title
|
||||
translation: Related
|
||||
|
||||
# Footer
|
||||
- id: footer_credits
|
||||
translation: "Powered by <a href=\"https://gohugo.io/\" rel=\"nofollow noopener\" target=\"_blank\">Hugo</a> and <a href=\"https://github.com/vimux/binario\" rel=\"nofollow noopener\" target=\"_blank\">Binario</a> theme."
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
{{ end }}
|
||||
</article>
|
||||
</div>
|
||||
{{ partial "related.html" . }}
|
||||
{{ partial "comments.html" . }}
|
||||
</div>
|
||||
{{ partial "footer.html" . }}
|
11
layouts/partials/related.html
Normal file
11
layouts/partials/related.html
Normal file
|
@ -0,0 +1,11 @@
|
|||
{{ $related := .Site.RegularPages.Related . | first 5 }}
|
||||
{{ with $related }}
|
||||
<div class="related block">
|
||||
<h3 class="related__title">{{ T "related_title" }}</h3>
|
||||
<ul class="related__list">
|
||||
{{ range . }}
|
||||
<li class="related__item"><a class="related__link" href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
{{ end }}
|
|
@ -706,6 +706,11 @@ mark {
|
|||
margin-bottom: .625rem;
|
||||
}
|
||||
|
||||
/*Related */
|
||||
.related {
|
||||
margin-top: .625rem;
|
||||
}
|
||||
|
||||
/* Pagination */
|
||||
.pagination {
|
||||
margin-bottom: .625rem;
|
||||
|
|
Loading…
Reference in a new issue