From 8c6fc5eb3ae31cac5881eca69c873894e4fc3b5c Mon Sep 17 00:00:00 2001
From: swissky <30409887+swissky@users.noreply.github.com>
Date: Sat, 11 Jul 2026 21:13:44 +0200
Subject: [PATCH 1/2] feat(core): apply SEO panel values by default in
EmDashHead
Values set in the admin SEO panel were silently ignored unless the page
template manually wired getSeoMeta() (#1518). EmDashHead now fetches the
entry's _emdash_seo row when the page context references a content entry
and inserts the panel values as a contribution layer between plugins and
the template-provided base metadata: editors' panel settings take effect
by default, plugins can still override everything.
- generateSeoPanelContributions(): pure generator for the panel layer
(og/twitter title, description, image incl. large-card upgrade,
canonical + og:url, robots noindex)
- resolveSeoCanonicalUrl(): shared canonical resolution, absolutized
against the site URL for / og:url
- Gated on the collection's hasSeo flag via the request- and
worker-cached getCollectionInfo(), so non-SEO collections skip the
lookup; the seo row fetch itself is request-cached
- The
element remains the template's responsibility (head
components cannot replace it); seo.title feeds og:title/twitter:title
Query-count snapshots updated: +1 on content pages of SEO-enabled
collections (the _emdash_seo PK lookup), +1 collection-info lookup where
it was not already cached.
---
.changeset/emdashhead-seo-panel.md | 5 +
.../src/content/docs/guides/site-settings.mdx | 7 +
.../docs/plugins/creating-plugins/hooks.mdx | 2 +-
packages/core/src/components/EmDashHead.astro | 38 +++++-
packages/core/src/page/index.ts | 6 +-
packages/core/src/page/seo-contributions.ts | 72 +++++++++-
packages/core/src/seo/media-url.ts | 19 +++
.../tests/unit/page/seo-contributions.test.ts | 124 +++++++++++++++++-
scripts/query-counts.queries.d1.json | 4 +
scripts/query-counts.queries.sqlite.json | 4 +
scripts/query-counts.snapshot.d1.json | 8 +-
scripts/query-counts.snapshot.sqlite.json | 8 +-
12 files changed, 279 insertions(+), 18 deletions(-)
create mode 100644 .changeset/emdashhead-seo-panel.md
diff --git a/.changeset/emdashhead-seo-panel.md b/.changeset/emdashhead-seo-panel.md
new file mode 100644
index 0000000000..d241da3c7d
--- /dev/null
+++ b/.changeset/emdashhead-seo-panel.md
@@ -0,0 +1,5 @@
+---
+"emdash": minor
+---
+
+`` now applies the entry's SEO panel values (title, description, image, canonical, noindex) automatically on content pages. Editor-set panel values override template-provided metadata, while plugin contributions still take precedence. Previously the panel was silently ignored unless the page wired `getSeoMeta()` by hand. The `` element remains the template's responsibility.
diff --git a/docs/src/content/docs/guides/site-settings.mdx b/docs/src/content/docs/guides/site-settings.mdx
index 586e80477a..ee1f6e9bcc 100644
--- a/docs/src/content/docs/guides/site-settings.mdx
+++ b/docs/src/content/docs/guides/site-settings.mdx
@@ -171,6 +171,13 @@ const platforms = [
### SEO Meta Tags
+
+
The following component builds document and Open Graph meta tags from site settings:
```astro title="src/components/SEO.astro"
diff --git a/docs/src/content/docs/plugins/creating-plugins/hooks.mdx b/docs/src/content/docs/plugins/creating-plugins/hooks.mdx
index 6573fccc4a..31cf63d21a 100644
--- a/docs/src/content/docs/plugins/creating-plugins/hooks.mdx
+++ b/docs/src/content/docs/plugins/creating-plugins/hooks.mdx
@@ -315,7 +315,7 @@ Contributes typed metadata to `` — meta tags, OpenGraph properties, allo
| `link` | `` | canonical: singleton; alternate: `key` or `hreflang` |
| `jsonld` | `