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 { .pagination__wrapper {
display: grid; display: grid;
place-content: center; place-content: center;
margin-top: 1.5em; margin-top: 3em;
} }
.pagination { .pagination {

View File

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

View File

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

View File

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