Adjust changelogs layout

This commit is contained in:
Helen Chong 2024-05-22 14:11:20 +08:00
parent e605e8685b
commit 3e8950bf55
4 changed files with 18 additions and 33 deletions

View File

@ -56,7 +56,7 @@
.pagination__wrapper {
display: grid;
place-content: center;
margin-top: 1.5em;
margin-top: 3em;
}
.pagination {

View File

@ -1,15 +1,7 @@
<article>
{% for log in changelogList | reverse %}
<div class="heading-wrapper h2">
<h2 id="{{ log.fileSlug }}">{{ log.date | formatDate }}</h2>
<a class="heading-anchor" href="#{{ log.fileSlug }}" aria-labelledby="{{ log.fileSlug }}"><span hidden="">#</span></a>
</div>
{{ log.templateContent | safe }}
{%- endfor %}
</article>
<style>
.heading-wrapper + ul {
margin: 0.3em 0 3em 0;
}
</style>
{% for log in changelogList | reverse %}
<div class="heading-wrapper h2">
<h2 id="{{ log.fileSlug }}">{{ log.date | formatDate }}</h2>
<a class="heading-anchor" href="#{{ log.fileSlug }}" aria-labelledby="{{ log.fileSlug }}"><span hidden="">#</span></a>
</div>
{{ log.templateContent | safe }}
{%- endfor %}

View File

@ -41,6 +41,11 @@ h3:has(+ *[class]:not(.heading-anchor)), .h3:has(+ *[class]) {
margin-bottom: 0.5em;
}
* + h2,
* + h3 {
margin-top: 1.5em;
}
hr {
border: 0.05rem solid var(--clr-title-border);
}

View File

@ -16,22 +16,10 @@ eleventyNavigation:
order: 9
---
<article>
<h2>Latest Changelogs</h2>
{% for log in changelogs %}
<h3 class="date-style">{{ log.data.date | formatDate }}</h3>
{{ log.templateContent | safe }}
{%- endfor %}
</article>
<h2>Latest Changelogs</h2>
{% for log in changelogs %}
<h3 class="date-style">{{ log.data.date | formatDate }}</h3>
{{ log.templateContent | safe }}
{%- endfor %}
{% include "global/pagination-oldnew.njk" %}
<style>
h2 + h3 {
margin-top: 1.5em;
}
h3 + ul {
margin-bottom: 3em;
}
</style>