Replace See also with a nicer looking Related posts section

This commit is contained in:
BBaoVanC 2022-04-10 02:14:42 -05:00
parent dff23045a8
commit e8f9d1c5df
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A
4 changed files with 24 additions and 16 deletions

View File

@ -70,7 +70,8 @@
} }
.page-list li, .page-list li,
.series-taxonomy li { .series-taxonomy li,
.related-posts .post {
padding-top: 8px; padding-top: 8px;
padding-left: 24px; padding-left: 24px;
padding-right: 24px; padding-right: 24px;
@ -239,6 +240,19 @@
padding: 8px 15px; padding: 8px 15px;
} }
.related-posts {
display: flex;
flex-wrap: wrap;
justify-content: space-evenly;
gap: 10px;
align-items: stretch; /* this is default anyways */
}
.related-posts .post {
min-width: 10%;
flex: 1 1 49%;
}
#back-to-top { #back-to-top {
position: fixed; position: fixed;
float: right; float: right;

View File

@ -35,8 +35,8 @@ post_count:
read_more: read_more:
other: "Read more" other: "Read more"
see_also: related_posts:
other: "See also" other: "Related posts"
older_post: older_post:
other: "Older" other: "Older"

View File

@ -35,8 +35,8 @@ no_posts:
read_more: read_more:
other: "Leer más" other: "Leer más"
see_also: related_posts:
other: "Véase también" other: "Publicaciones similares"
older_post: older_post:
other: "Más antiguo" other: "Más antiguo"

View File

@ -52,17 +52,11 @@
{{ $related := .Site.RegularPages.Related . | first 5 }} {{ $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related }} {{ with $related }}
<div class="see-also"> <h2>{{ i18n "related_posts" }}</h2>
<h2>{{ i18n "see_also" }}</h2> <div class="related-posts">
{{ range . }}
<ul> {{ .Render "summary/post" }}
{{ range . }} {{ end }}
<li>
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</li>
{{ end }}
</ul>
</div> </div>
{{ end }} {{ end }}