This commit is contained in:
parent
fb5a3b8093
commit
58d8b661a8
1055 changed files with 116254 additions and 89 deletions
29
sites/research/src/pages/[...slug].astro
Normal file
29
sites/research/src/pages/[...slug].astro
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
import { getCollection, render } from 'astro:content';
|
||||
import DefaultLayout from '@/layouts/DefaultLayout.astro';
|
||||
import { BlogPost } from '@/components/sections/blog-post';
|
||||
import NewsletterSignup from '@/components/sections/newsletter-signup';
|
||||
import { ACTIVE_BLOG_SITE } from '@/blog-sites.js';
|
||||
import { SITE_TITLE } from '@/consts';
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const posts = await getCollection(ACTIVE_BLOG_SITE.key);
|
||||
return posts.map((post) => ({
|
||||
params: { slug: post.id },
|
||||
props: post,
|
||||
}));
|
||||
}
|
||||
|
||||
const post = Astro.props;
|
||||
const { Content } = await render(post);
|
||||
---
|
||||
|
||||
<DefaultLayout title={`${post.data.title} | ${SITE_TITLE}`} description={post.data.description}>
|
||||
<div class="py-16 md:py-28 lg:py-32">
|
||||
<BlogPost post={post} client:only="react">
|
||||
<Content />
|
||||
</BlogPost>
|
||||
</div>
|
||||
|
||||
<NewsletterSignup client:load />
|
||||
</DefaultLayout>
|
||||
Loading…
Add table
Add a link
Reference in a new issue