diff --git a/src/content/config.ts b/src/content/config.ts index 6f03d72..eb11fba 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -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(), }), diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index 07b67e7..751ed5e 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -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; --- diff --git a/src/layouts/PageLayout.astro b/src/layouts/PageLayout.astro index 5f6319f..159e374 100644 --- a/src/layouts/PageLayout.astro +++ b/src/layouts/PageLayout.astro @@ -20,8 +20,8 @@ const { page } = Astro.props; const { Content, headings } = await page.render(); --- - - + +
diff --git a/src/pages/og/[slug].png.ts b/src/pages/og/[slug].png.ts index 13ccd79..67ae3dc 100644 --- a/src/pages/og/[slug].png.ts +++ b/src/pages/og/[slug].png.ts @@ -1,5 +1,6 @@ import { defaultOpenGraph, drawOpenGraph } from '@/helpers/og'; import { getPage, getPost, pages, posts } from '@/helpers/schema'; +import options from '@/options'; import type { APIRoute } from 'astro'; const fallback = async () => @@ -29,7 +30,7 @@ export const GET: APIRoute = async ({ params }) => { } title = page.title; - summary = page.summary; + summary = page.summary || options.description; cover = page.cover.src; } else { title = post.title;