feat: add extra metadata for page.
This commit is contained in:
parent
0aba200b9f
commit
f3f3623cd5
src
@ -108,7 +108,7 @@ const pagesCollection = defineCollection({
|
||||
comments: z.boolean().optional().default(true),
|
||||
cover: image(defaultCover),
|
||||
published: z.boolean().optional().default(true),
|
||||
summary: z.string().optional().default(''),
|
||||
summary: z.string().optional(),
|
||||
friend: z.boolean().optional().default(false),
|
||||
toc: toc(),
|
||||
}),
|
||||
|
@ -24,7 +24,7 @@ const title =
|
||||
? `${options.title} - ${options.description}`
|
||||
: `${Astro.props.title} - ${options.title}`;
|
||||
const description = Astro.props.description || options.description;
|
||||
const showFooter = Astro.props.footer || true;
|
||||
const showFooter = Astro.props.footer !== undefined ? Astro.props.footer : true;
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
|
@ -20,8 +20,8 @@ const { page } = Astro.props;
|
||||
const { Content, headings } = await page.render();
|
||||
---
|
||||
|
||||
<BaseLayout title={page.title} footer={false}>
|
||||
<PageMeta slot="og" title={page.title} ogImageUrl={`/og/${page.slug}.png`} />
|
||||
<BaseLayout title={page.title} description={page.summary} footer={false}>
|
||||
<PageMeta slot="og" title={page.title} description={page.summary} ogImageUrl={`/og/${page.slug}.png`} />
|
||||
|
||||
<div class="row gx-0">
|
||||
<div class="col-lg-8 col-xl-7">
|
||||
|
Loading…
Reference in New Issue
Block a user