mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2024-12-22 04:13:17 -06:00
Better related posts section
This commit is contained in:
parent
b14e0e90fd
commit
2113c7a4e9
@ -244,19 +244,31 @@
|
|||||||
padding: 8px 15px;
|
padding: 8px 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Related posts */
|
||||||
|
.related hr {
|
||||||
|
margin: 25px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 720px) {
|
||||||
|
.related {
|
||||||
|
/* this makes it full width -- 720px max-width on body */
|
||||||
|
margin-left: calc(-100vw / 2 + 760px / 2);
|
||||||
|
margin-right: calc(-100vw / 2 + 760px / 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.related-posts {
|
.related-posts {
|
||||||
display: flex;
|
display: grid;
|
||||||
flex-wrap: wrap;
|
gap: 20px;
|
||||||
justify-content: space-evenly;
|
grid-template-columns: repeat(auto-fit, minmax(0, 360px));
|
||||||
gap: 10px;
|
|
||||||
align-items: stretch; /* this is default anyways */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.related-posts .post {
|
.related-posts .post {
|
||||||
min-width: 10%;
|
|
||||||
flex: 1 1 49%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Back to top */
|
||||||
#back-to-top {
|
#back-to-top {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
float: right;
|
float: right;
|
||||||
|
@ -50,13 +50,17 @@
|
|||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ $related := .Site.RegularPages.Related . | first 5 }}
|
{{ $related := .Site.RegularPages.Related . | first 10 }}
|
||||||
{{ with $related }}
|
{{ with $related }}
|
||||||
<h2>{{ i18n "related_posts" }}</h2>
|
<div class="related">
|
||||||
<div class="related-posts">
|
<hr>
|
||||||
{{ range . }}
|
<h2>{{ i18n "related_posts" }}</h2>
|
||||||
{{ .Render "summary/post" }}
|
<div class="related-posts">
|
||||||
{{ end }}
|
{{ range . }}
|
||||||
|
{{ .Render "summary/post" }}
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user