Add initial "related articles" block

This commit is contained in:
vimux 2018-05-25 17:29:46 +03:00
parent 216780dc4b
commit 5d3bea73a5
No known key found for this signature in database
GPG key ID: 5A34FDC4EE832E34
4 changed files with 21 additions and 0 deletions

View file

@ -8,6 +8,10 @@
- id: meta_categories - id: meta_categories
translation: Categories translation: Categories
# Related
- id: related_title
translation: Related
# Footer # Footer
- id: footer_credits - 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." 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."

View file

@ -14,6 +14,7 @@
{{ end }} {{ end }}
</article> </article>
</div> </div>
{{ partial "related.html" . }}
{{ partial "comments.html" . }} {{ partial "comments.html" . }}
</div> </div>
{{ partial "footer.html" . }} {{ partial "footer.html" . }}

View 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 }}

View file

@ -706,6 +706,11 @@ mark {
margin-bottom: .625rem; margin-bottom: .625rem;
} }
/*Related */
.related {
margin-top: .625rem;
}
/* Pagination */ /* Pagination */
.pagination { .pagination {
margin-bottom: .625rem; margin-bottom: .625rem;