Skip to content

Commit 5383c6b

Browse files
Refactor content schemas, docs structure, and blog OG generation (#1884)
* feat(content): update content collection schemas and slug generation * docs(content): add section metadata to documentation files * feat(og): add author and date to blog og schema * feat(docs): improve docs routing and structure handling * style(legal): enhance legal pages layout and background * feat(blog): generate dynamic og image for blog posts
1 parent 54e1f76 commit 5383c6b

26 files changed

+196
-149
lines changed

apps/web/content-collections.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const articles = defineCollection({
4040
display_title: z.string().optional(),
4141
meta_title: z.string(),
4242
meta_description: z.string(),
43-
author: z.string(),
43+
author: z.enum(["Harshika", "John Jeong", "Yujong Lee"]),
4444
created: z.string(),
4545
updated: z.string().optional(),
4646
coverImage: z.string().optional(),
@@ -133,6 +133,7 @@ const docs = defineCollection({
133133
exclude: ["AGENTS.md", "hooks/**", "deeplinks/**"],
134134
schema: z.object({
135135
title: z.string(),
136+
section: z.string(),
136137
summary: z.string().optional(),
137138
category: z.string().optional(),
138139
author: z.string().optional(),
@@ -163,16 +164,25 @@ const docs = defineCollection({
163164

164165
const sectionFolder = pathParts[0] || "general";
165166

166-
const slug = document._meta.path.replace(/\.mdx$/, "");
167-
168167
const isIndex = fileName === "index";
169168

169+
const orderMatch = fileName.match(/^(\d+)\./);
170+
const order = orderMatch ? parseInt(orderMatch[1], 10) : 999;
171+
172+
const cleanFileName = fileName.replace(/^\d+\./, "");
173+
const cleanPath =
174+
pathParts.length > 0
175+
? `${pathParts.join("/")}/${cleanFileName}`
176+
: cleanFileName;
177+
const slug = cleanPath;
178+
170179
return {
171180
...document,
172181
mdx,
173182
slug,
174183
sectionFolder,
175184
isIndex,
185+
order,
176186
toc,
177187
};
178188
},

apps/web/content/docs/index.mdx renamed to apps/web/content/docs/about/0.hello-world.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: "Hello World!"
3+
section: "About"
34
description: "We are making a world where work is simply talking to others and thinking deeply on your own — nothing else needs to be done."
45
---
56

apps/web/content/docs/about-hyprnote/what-is-hyprnote.mdx renamed to apps/web/content/docs/about/1.what-is-hyprnote.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: "What is Hyprnote?"
3+
section: "About"
34
description: "Hyprnote is a privacy-first AI notepad for meetings. Think of it as the open-source version of Granola — except that we're cooler."
45
---
56

apps/web/content/docs/about-hyprnote/why-local-first.mdx renamed to apps/web/content/docs/about/2.why-local-first.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: "Why Local-First?"
3+
section: "About"
34
description: "What if I said Excel beats Google Sheets? Not because it's Microsoft(lol), but because it's local-first."
45
---
56

apps/web/content/docs/about-hyprnote/why-self-hosted.mdx renamed to apps/web/content/docs/about/3.why-self-hosted.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: "Why Self-Hosted?"
3+
section: "About"
34
description: "Why the heck would you want to self-host Hyprnote? Because you can, and because it gives you control over your data and privacy."
45
---
56

apps/web/content/docs/cli.mdx

Lines changed: 0 additions & 4 deletions
This file was deleted.

apps/web/content/docs/analytics.mdx renamed to apps/web/content/docs/developers/0.analytics.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
2-
title: Analytics
3-
description: Learn about analytics in Hyprnote
2+
title: "Analytics"
3+
section: "Developers"
4+
description: "Learn about analytics in Hyprnote"
45
---
56

67
## Analytics

apps/web/content/docs/bug-report.mdx renamed to apps/web/content/docs/developers/1.bug-report.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: "Bug Reports & Debugging"
3+
section: "Developers"
34
description: "How to report bugs and find log files for troubleshooting Hyprnote"
45
---
56

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: "CLI"
3+
section: "Developers"
4+
description: "Learn how to use CLI in Hyprnote"
5+
---

apps/web/content/docs/deeplinks.mdx renamed to apps/web/content/docs/developers/3.deeplinks.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
2-
title: Deeplinks
3-
summary: Learn how to use deeplinks in Hyprnote
2+
title: "Deeplinks"
3+
section: "Developers"
4+
summary: "Learn how to use deeplinks in Hyprnote"
45
---
56

67
# Overview

0 commit comments

Comments
 (0)