Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 3 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion src/components/handbook/Article.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
// src/components/handbook/Article.astro
import { getCollection, getEntry, render } from 'astro:content';
import { Breadcrumbs } from 'astro-breadcrumbs';
import Sidebar from '@components/handbook/Sidebar.astro';
Expand Down Expand Up @@ -234,7 +235,12 @@ handbooks.forEach((collection) => {
</div>

{/* Navigation */}
<PageNav currentArticleId={articleId} categories={categories} items={items} />
<PageNav
currentArticleId={articleId}
categories={categories}
items={items}
lastUpdated={mainArticleEntry?.data.lastUpdated}
/>
</article>

<aside class="handbook-toc">
Expand Down
24 changes: 24 additions & 0 deletions src/components/handbook/LastUpdated.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
import { formatLongDate, formatISODate } from '@utils/dateUtils';
interface LastUpdatedProps {
date?: Date;
}
const { date } = Astro.props as LastUpdatedProps;
if (!date) {
return null;
}
const formattedDate = formatLongDate(date);
const dateTime = formatISODate(date);
---

{
date && (
<p class="last-updated">
Last updated: <time datetime={dateTime}>{formattedDate}</time>
</p>
)
}
43 changes: 26 additions & 17 deletions src/components/handbook/PageNav.astro
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
---
// src/components/handbook/PageNav.astro
import ArticleNavigation from '@components/ArticleNavigation.astro';
import LastUpdated from '@components/handbook/LastUpdated.astro';
import type { SidebarItems } from '@/src/types/common';

const {
currentArticleId,
items,
lastUpdated,
class: className,
} = Astro.props as {
currentArticleId: string;
class?: string;
items: SidebarItems[];
lastUpdated?: Date;
};

const handbookItems: Array<{ id: string; data: { title: string } }> = [];
Expand All @@ -32,20 +36,25 @@ const nextArticle =
currentIndex < handbookItems.length - 1 ? handbookItems[currentIndex + 1] : undefined;
---

<ArticleNavigation
previousArticle={previousArticle
? {
id: previousArticle.id,
title: previousArticle.data.title,
url: `/handbook/${previousArticle.id}/`,
}
: undefined}
nextArticle={nextArticle
? {
id: nextArticle.id,
title: nextArticle.data.title,
url: `/handbook/${nextArticle.id}/`,
}
: undefined}
class={className}
/>
{/* Last Updated */}
<footer id="footer-article" class="article-footer">
{lastUpdated && <LastUpdated date={lastUpdated} />}

<ArticleNavigation
previousArticle={previousArticle
? {
id: previousArticle.id,
title: previousArticle.data.title,
url: `/handbook/${previousArticle.id}/`,
}
: undefined}
nextArticle={nextArticle
? {
id: nextArticle.id,
title: nextArticle.data.title,
url: `/handbook/${nextArticle.id}/`,
}
: undefined}
class={className}
/>
</footer>
1 change: 1 addition & 0 deletions src/content.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ const handbooks = defineCollection({
draft: z.boolean().optional(),
readingTime: z.string().optional(),
updatedDate: z.string().optional(),
lastUpdated: z.date().optional(),
authors: z.string().optional(),
sidebar: z.object({
label: z.string().optional(),
Expand Down
1 change: 1 addition & 0 deletions src/content/handbook/policy/code-of-conduct.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Code of conduct
lastUpdated: 2025-12-04
sidebar:
label: Code of conduct
order: 1
Expand Down
13 changes: 13 additions & 0 deletions src/v1/styles/components.css
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,19 @@
@apply mt-10 flex flex-col gap-4 md:mt-14 md:flex-row;
}

.article-footer {
@apply mt-10 md:mt-14;
@apply flex flex-col gap-6;
.article-nav {
@apply mt-0 md:mt-0;
}

.last-updated {
@apply datum-text-sm mb-0 text-right;
@apply text-midnight-fjord;
}
}

.article-nav-item {
@apply hover:text-midnight-fjord/80 text-midnight-fjord border-midnight-fjord hover:bg-midnight-fjord/5 hover:border-midnight-fjord/80;
@apply w-full gap-2 border transition-colors duration-200;
Expand Down