Style blog archive page

This commit is contained in:
Helen Chong 2024-04-17 20:20:20 +08:00
parent 61abcb544f
commit ca27552e5f
1 changed files with 15 additions and 16 deletions

View File

@ -12,8 +12,8 @@ blogNav: Archive
<ul class="blog__postlist"> <ul class="blog__postlist">
{% for post in postList %} {% for post in postList %}
<li> <li class="blog__postlist--item">
<h2 class="blog__title"> <h2 class="blog__postlist--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 %}
@ -22,21 +22,20 @@ blogNav: Archive
</a> </a>
</h2> </h2>
<time>{{ post.date | niceDate }}</time> <time>{{ post.date | niceDate }}</time>
<p>{{ post.data.desc }}</p>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
<p class="center-text"> <style>
{% if pagination.href.previous %} .blog__postlist {
<a href=" {{ pagination.href.previous }}">Previous</a> display: grid;
{% else %} gap: 1em;
Previous padding-left: 1em;
{% endif %} }
/
{% if pagination.href.next %} .blog__postlist--title {
<a href=" {{ pagination.href.next }}">Next</a> font-size: clamp(1.55rem, 1rem + 3vw, 1.3rem);
{% else %} line-height: 1.3;
Next margin-bottom: 0.2em;
{% endif %} }
</p> </style>