Footer and login legal links were stubs. Point them at real marketing pages that follow the Figma content-page template.
54 lines
1.2 KiB
TypeScript
54 lines
1.2 KiB
TypeScript
import type { BlogPost } from "./content";
|
|
|
|
export type LegalDocumentSlug = "privacy" | "terms" | "cookies";
|
|
|
|
export type LegalDocumentSection = {
|
|
heading: string;
|
|
paragraphs: string[];
|
|
};
|
|
|
|
export type LegalDocumentMessages = {
|
|
banner: {
|
|
title: string;
|
|
description: string;
|
|
author: string;
|
|
date: string;
|
|
};
|
|
updated: string;
|
|
intro: string[];
|
|
sections: LegalDocumentSection[];
|
|
};
|
|
|
|
const PATH_BY_SLUG: Record<LegalDocumentSlug, string> = {
|
|
privacy: "/privacy",
|
|
terms: "/terms",
|
|
cookies: "/cookies",
|
|
};
|
|
|
|
export function legalPathForSlug(slug: LegalDocumentSlug): string {
|
|
return PATH_BY_SLUG[slug];
|
|
}
|
|
|
|
/**
|
|
* Builds a {@link BlogPost}-shaped object so legal pages can reuse
|
|
* `ContentBanner` (guide variant) without a markdown file.
|
|
*/
|
|
export function buildLegalSyntheticPost(
|
|
slug: LegalDocumentSlug,
|
|
page: LegalDocumentMessages,
|
|
): BlogPost {
|
|
return {
|
|
slug: `__legal__:${slug}`,
|
|
frontmatter: {
|
|
title: page.banner.title,
|
|
description: page.banner.description,
|
|
author: page.banner.author,
|
|
date: page.banner.date,
|
|
},
|
|
content: "",
|
|
htmlContent: "",
|
|
filePath: `messages/en/pages/${slug}.json`,
|
|
lastModified: new Date(page.banner.date),
|
|
};
|
|
}
|