initial commit

This commit is contained in:
grassblock 2025-05-01 16:53:18 +08:00
commit 61511ed28c
28 changed files with 5210 additions and 0 deletions

View file

@ -0,0 +1,18 @@
import { getCollection } from 'astro:content';
export async function GET() {
const posts = await getCollection('blog');
const searchIndex = posts.map(post => ({
title: post.data.title,
description: post.data.description,
content: post.body,
pubDate: post.data.pubDate,
slug: post.slug
}));
return new Response(JSON.stringify(searchIndex), {
headers: {
'Content-Type': 'application/json'
}
});
}