mirror of
https://github.com/10h30/astroplate.git
synced 2026-07-17 05:33:28 +09:00
23 lines
526 B
Plaintext
Executable File
23 lines
526 B
Plaintext
Executable File
---
|
|
import config from "@/config/config.json";
|
|
import Base from "@/layouts/Base.astro";
|
|
import Search from "@/layouts/Search";
|
|
import { getSinglePage } from "@/lib/contentParser.astro";
|
|
|
|
const { blog_folder } = config.settings;
|
|
|
|
// Retrieve all articles
|
|
const posts = await getSinglePage(blog_folder);
|
|
|
|
// List of items to search in
|
|
const searchList = posts.map((item) => ({
|
|
slug: item.slug,
|
|
data: item.data,
|
|
content: item.body,
|
|
}));
|
|
---
|
|
|
|
<Base title={`Search`}>
|
|
<Search client:load searchList={searchList} />
|
|
</Base>
|