Style display of blog posts

This commit is contained in:
Helen Chong 2024-04-17 20:11:14 +08:00
parent 71a4b49a9f
commit 61abcb544f
1 changed files with 33 additions and 3 deletions

View File

@ -14,10 +14,10 @@ pagination:
permalink: "/{{ page.fileSlug }}{% if pagination.pageNumber > 0 %}/page/{{ pagination.pageNumber + 1 }}{% endif %}/" permalink: "/{{ page.fileSlug }}{% if pagination.pageNumber > 0 %}/page/{{ pagination.pageNumber + 1 }}{% endif %}/"
--- ---
<ul class="blog__postlist"> <ul class="blog__posts">
{% for post in postList %} {% for post in postList %}
<li> <li class="blog__post">
<h2 class="blog__title"> <h2 class="blog__post--title">
<a href="{{ post.url }}"> <a href="{{ post.url }}">
{% if post.data.title %}{{ post.data.articleTitle }} {% if post.data.title %}{{ post.data.articleTitle }}
{% else %} {% else %}
@ -32,3 +32,33 @@ permalink: "/{{ page.fileSlug }}{% if pagination.pageNumber > 0 %}/page/{{ pagin
</ul> </ul>
{% include "global/pagination-oldnew.njk" %} {% include "global/pagination-oldnew.njk" %}
<style>
.blog__posts,
.blog__post {
display: grid;
}
.blog__posts {
list-style-type: none;
padding: 0;
margin: 0;
gap: 1.5em;
}
.blog__post {
gap: 0.6em;
padding-bottom: 1.5em;
border-bottom: 0.2em solid var(--clr-quote-border);
}
.blog__post--title {
font-size: clamp(1.55rem, 1rem + 3vw, 1.8rem);
line-height: 1.3;
}
.blog__post time {
color: var(--clr-sub-heading);
font-weight: 600;
}
</style>