mirror of
https://github.com/10h30/astroplate.git
synced 2026-07-20 15:13:39 +09:00
31 lines
639 B
Plaintext
Executable File
31 lines
639 B
Plaintext
Executable File
---
|
|
import Base from "@/layouts/Base.astro";
|
|
import PostSingle from "@/layouts/PostSingle.astro";
|
|
import { getSinglePage } from "@/lib/contentParser.astro";
|
|
|
|
export async function getStaticPaths() {
|
|
const BLOG_FOLDER = "blog";
|
|
const posts = await getSinglePage(BLOG_FOLDER);
|
|
|
|
const paths = posts.map((post) => ({
|
|
params: {
|
|
single: post.slug,
|
|
},
|
|
props: { post },
|
|
}));
|
|
return paths;
|
|
}
|
|
|
|
const { post } = Astro.props;
|
|
const { title, meta_title, description, image } = post.data;
|
|
---
|
|
|
|
<Base
|
|
title={title}
|
|
meta_title={meta_title}
|
|
description={description}
|
|
image={image}
|
|
>
|
|
<PostSingle post={post} />
|
|
</Base>
|