Skip to content

Commit 66aa5de

Browse files
committed
[Docs Site] Change date format in changelog, adjust dropdown margin
1 parent fd0e5ea commit 66aa5de

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/pages/changelog/index.astro

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
22
import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro";
3-
import { Aside, Badge } from "~/components";
3+
import { Aside } from "~/components";
44
import { marked } from "marked";
5+
import { format } from "date-fns";
56
import { getChangelogs } from "~/util/changelogs";
67
78
const { products, productAreas, changelogs } = await getChangelogs();
@@ -27,7 +28,7 @@ const { products, productAreas, changelogs } = await getChangelogs();
2728
</p>
2829
<br />
2930
<label for="products">Product:</label>
30-
<select name="products" id="products">
31+
<select name="products" id="products" class="mr-4">
3132
<option value="all">Select...</option>
3233
{
3334
products.map((product) => (
@@ -46,9 +47,9 @@ const { products, productAreas, changelogs } = await getChangelogs();
4647
</select>
4748
{
4849
changelogs.map(([date, entries]) => (
49-
<div class="md:grid md:grid-cols-[20%_80%]" data-date={date}>
50+
<div class="md:grid md:grid-cols-[18%_82%]" data-date={date}>
5051
<div>
51-
<h2 class="text-nowrap">{date}</h2>
52+
<h4 class="text-nowrap">{format(date, "do MMMM yyyy")}</h4>
5253
</div>
5354
<div class="!mt-0">
5455
{entries?.map((entry) => (
@@ -102,7 +103,7 @@ const { products, productAreas, changelogs } = await getChangelogs();
102103
const navHeightPx = Number(navHeightRem.split("rem")[0]) * 16 + 16;
103104

104105
const headers = document.querySelectorAll<HTMLElement>(
105-
"[data-date] > div > h2",
106+
"[data-date] > div > h4",
106107
);
107108
headers.forEach(
108109
(header) => new StickyHeader(header, { offset: 0 - navHeightPx }),
@@ -162,7 +163,7 @@ const { products, productAreas, changelogs } = await getChangelogs();
162163
</script>
163164

164165
<style>
165-
h2.sticky-pinned {
166+
h4.sticky-pinned {
166167
top: var(--sl-nav-height);
167168
background-color: var(--sl-color-bg);
168169
}

0 commit comments

Comments
 (0)