diff options
| author | Valentin Popov <valentin@popov.link> | 2026-04-22 19:11:58 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-04-22 19:11:58 +0300 |
| commit | 5e818d804d5d38beff0f3754a006333752fd5082 (patch) | |
| tree | 7f2d1097390bbdb3c5fa1593f6d15d6dfb3b0dd8 /src/layouts | |
| parent | 41bb3099660b6210a419c4190a1bc08d7ba58c00 (diff) | |
| download | popov.link-5e818d804d5d38beff0f3754a006333752fd5082.tar.xz popov.link-5e818d804d5d38beff0f3754a006333752fd5082.zip | |
refactor: update schema handling and improve SEO metadata
- Changed schema type from WithContext<Thing> to Thing[] in Head, BaseLayout, and JsonLd components for better flexibility.
- Added optional robots meta tag to Head component.
- Updated JSON-LD generation in JsonLd component to include a structured payload.
- Enhanced page and blog schemas to support breadcrumb and person schemas for improved SEO.
- Introduced new utility schemas for website and person to streamline schema generation.
- Refactored existing schemas to align with the new structure and ensure consistency across components.
Diffstat (limited to 'src/layouts')
| -rw-r--r-- | src/layouts/BaseLayout.astro | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index ed3baeb..a2f0327 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -1,5 +1,5 @@ --- -import type { WithContext, Thing } from "schema-dts"; +import type { Thing } from "schema-dts"; import Analytics from "../components/Analytics.astro"; import Head from "../components/Head.astro"; import Header from "../components/Header.astro"; @@ -9,15 +9,16 @@ type Props = { readonly description: string; readonly lang: string; readonly preview: string; - readonly schema: WithContext<Thing>; + readonly robots?: string; + readonly schema: Thing[]; readonly title: string; }; -const { description, lang, preview, schema, title } = Astro.props; +const { description, lang, preview, robots, schema, title } = Astro.props; --- <html lang={lang}> - <Head title={title} description={description} preview={preview} schema={schema} /> + <Head title={title} description={description} preview={preview} robots={robots} schema={schema} /> <body> <main> |
