Skip to content

Commit 2ba53ad

Browse files
maxholmanclaude
andcommitted
fix(website): restore website build
justfile module set working-directory to "website" which resolved to website/website/ when loaded as a module, breaking shell resolution. Content config was in the Astro 5 location (src/content/config.ts) with no loader — Astro 6 requires src/content.config.ts with a glob loader. Pages used removed .slug and .render() APIs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c37b9ac commit 2ba53ad

5 files changed

Lines changed: 9 additions & 10 deletions

File tree

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import { glob } from "astro/loaders";
12
import { defineCollection, z } from "astro:content";
23

34
const docs = defineCollection({
4-
type: "content",
5+
loader: glob({ pattern: "**/*.{md,mdx,mdoc}", base: "./src/content/docs" }),
56
schema: z.object({
67
title: z.string(),
78
description: z.string(),

website/src/pages/[slug].astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
import { getCollection } from 'astro:content';
2+
import { getCollection, render } from 'astro:content';
33
import DocsLayout from '../layouts/DocsLayout.astro';
44
55
export async function getStaticPaths() {
66
const docs = await getCollection('docs');
77
return docs
8-
.filter((doc) => doc.slug !== 'index')
8+
.filter((doc) => doc.id !== 'index')
99
.map((doc) => ({
10-
params: { slug: doc.slug },
10+
params: { slug: doc.id },
1111
props: { doc },
1212
}));
1313
}
@@ -17,7 +17,7 @@ interface Props {
1717
}
1818
1919
const { doc } = Astro.props;
20-
const { Content } = await doc.render();
20+
const { Content } = await render(doc);
2121
---
2222

2323
<DocsLayout title={doc.data.title} description={doc.data.description}>

website/src/pages/index.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
import { getEntry } from 'astro:content';
2+
import { getEntry, render } from 'astro:content';
33
import DocsLayout from '../layouts/DocsLayout.astro';
44
55
const entry = await getEntry('docs', 'index');
66
if (!entry) {
77
throw new Error("docs/index.mdoc is missing — cannot render home page");
88
}
99
10-
const { Content } = await entry.render();
10+
const { Content } = await render(entry);
1111
---
1212

1313
<DocsLayout title={entry.data.title} description={entry.data.description}>

website/src/pages/og/[slug].png.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export async function getStaticPaths() {
2626
const docs = await getCollection("docs");
2727
return [
2828
...docs.map((doc) => ({
29-
params: { slug: doc.slug },
29+
params: { slug: doc.id },
3030
props: { title: doc.data.title, description: doc.data.description },
3131
})),
3232
{

website/website.just

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
set working-directory := "website"
2-
31
# Install website dependencies (pnpm, frozen lockfile)
42
deps:
53
pnpm install --frozen-lockfile --silent

0 commit comments

Comments
 (0)