Skip to content

Merge sitewide SEO tags instead of replacing them - #155

Merged
freekmurze merged 1 commit into
mainfrom
freekmurze/evaluate-laravel-head
Aug 7, 2026
Merged

Merge sitewide SEO tags instead of replacing them#155
freekmurze merged 1 commit into
mainfrom
freekmurze/evaluate-laravel-head

Conversation

@freekmurze

Copy link
Copy Markdown
Member

The seo partial was an @if/@else, so any page filling the seo slot dropped every sitewide tag: post pages rendered no meta description at all, and newsletter archive pages also lost og:url, og:site_name and og:locale. It now always renders the defaults and appends the slot, with pages overriding the description through a new description prop on x-app-layout, and the tags the defaults provide were removed from the post and newsletter slots so the merge does not duplicate them.

Also points the favicon at /favicon.ico (it resolved to /posts/favicon.ico on nested urls), drops the newsletter archive twitter:card that conflicted with the summary_large_image RenderOgImageMiddleware appends unconditionally, and switches og:url to url()->current() so it matches the canonical. Despite the branch name, this adds no dependency: laravel/head would fix this class of bug with its field-by-field merge, but it is at v0.1.0, so these fixes stand on their own for now.

The seo partial was an @if/@else, so any page filling the `seo` slot
dropped every sitewide tag. Post pages therefore rendered no meta
description at all, and newsletter archive pages also lost og:url,
og:site_name and og:locale.

The partial now always renders the defaults and appends the slot. Pages
can override the description through a new `description` prop on
x-app-layout. Tags the defaults provide were removed from the post and
newsletter slots so the merge doesn't duplicate them.

Also:
- Point the favicon at /favicon.ico so it stops resolving to
  /posts/favicon.ico on nested urls.
- Drop the hardcoded twitter:card from the newsletter archive, which
  conflicted with the summary_large_image that RenderOgImageMiddleware
  appends unconditionally.
- Use url()->current() for og:url so it matches the canonical and no
  longer emits query strings.

Co-Authored-By: Claude <noreply@anthropic.com>
@freekmurze
freekmurze merged commit 4edaab8 into main Aug 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant