site: media + colocation — chunk 1/4 (code, configs, docs)
Code, configs, README, CHANGELOG, sources/log files, .claude. Subsequent chunks land the renamed media files.
This commit is contained in:
+23
-4
@@ -1,8 +1,15 @@
|
||||
import { defineCollection, z } from 'astro:content';
|
||||
import { glob } from 'astro/loaders';
|
||||
|
||||
const stripIndex = ({ entry }: { entry: string }) =>
|
||||
entry.replace(/\/index\.mdx$/, '');
|
||||
|
||||
const reviews = defineCollection({
|
||||
loader: glob({ pattern: '**/*.mdx', base: './src/content/reviews' }),
|
||||
loader: glob({
|
||||
pattern: '**/index.mdx',
|
||||
base: './src/content/reviews',
|
||||
generateId: stripIndex,
|
||||
}),
|
||||
schema: z.object({
|
||||
name: z.string(),
|
||||
subtitle: z.string(),
|
||||
@@ -18,7 +25,11 @@ const reviews = defineCollection({
|
||||
});
|
||||
|
||||
const posts = defineCollection({
|
||||
loader: glob({ pattern: '**/*.mdx', base: './src/content/posts' }),
|
||||
loader: glob({
|
||||
pattern: '**/index.mdx',
|
||||
base: './src/content/posts',
|
||||
generateId: stripIndex,
|
||||
}),
|
||||
schema: z.object({
|
||||
title: z.string(),
|
||||
date: z.coerce.date(),
|
||||
@@ -29,7 +40,11 @@ const posts = defineCollection({
|
||||
});
|
||||
|
||||
const find = defineCollection({
|
||||
loader: glob({ pattern: '**/*.mdx', base: './src/content/find' }),
|
||||
loader: glob({
|
||||
pattern: '**/index.mdx',
|
||||
base: './src/content/find',
|
||||
generateId: stripIndex,
|
||||
}),
|
||||
schema: z.object({
|
||||
name: z.string(),
|
||||
subtitle: z.string().optional(),
|
||||
@@ -45,7 +60,11 @@ const find = defineCollection({
|
||||
});
|
||||
|
||||
const finds = defineCollection({
|
||||
loader: glob({ pattern: '**/*.mdx', base: './src/content/finds' }),
|
||||
loader: glob({
|
||||
pattern: '**/index.mdx',
|
||||
base: './src/content/finds',
|
||||
generateId: stripIndex,
|
||||
}),
|
||||
schema: z.object({
|
||||
title: z.string(),
|
||||
date: z.coerce.date(),
|
||||
|
||||
Reference in New Issue
Block a user