Skip to content

Conversation

@duncanmcclean
Copy link
Member

@duncanmcclean duncanmcclean commented Oct 28, 2025

This pull request adds Google, Twitter and Facebook previews to the SEO tab on entries & terms, making it easier to visualize your changes in search & social media.

The previews will update in real-time as you make changes to fields.

The only caveat to this is inherited fields using the "From Field" option - those values will be updated when you save, due to a limitation with how inherited fields work currently. We can fix it later if it becomes an issue.

To avoid constant network requests, I've tried to keep most of the logic in JavaScript. Only fields used in the collection's route will trigger network requests to fetch the updated entry URL.

Screenshot

CleanShot 2025-10-28 at 19 19 06

Note

Adds live search and social card previews to entries/terms, with a preview endpoint and blueprint tab adjustments.

  • Fieldtypes/UI:
    • Add resources/js/components/fieldtypes/PreviewsFieldtype.vue to render Google, X (Twitter), and Facebook previews with live updates, including favicon and image handling.
    • Register new component seo_pro_previews-fieldtype in resources/js/cp.js.
  • Backend:
    • New fieldtype Statamic\SeoPro\Fieldtypes\SeoProPreviews preloading initialUrl, routeFields, assetContainerUrl, and faviconUrl.
    • Add CP route POST seo-pro/preview handled by Statamic\SeoPro\Http\Controllers\CP\PreviewController to return updated absoluteUrl based on route-affecting fields.
  • Blueprint updates:
    • Insert seo field into SEO Meta tab (was SEO).
    • Add new seo_previews field in SEO Previews tab (prepended), and adjust removal logic accordingly.
  • CP improvements:
    • Sort Section Defaults lists: collections and taxonomies by title in SectionDefaultsController.
  • Dependencies:
    • Add striptags for content sanitization; bump vite to ^6.4.1.

Written by Cursor Bugbot for commit 09414c6. This will update automatically on new commits. Configure here.

@jackmcdade
Copy link
Member

This looks awesome! I can't review it though because checking this branch out gives me errors 🤔
CleanShot 2025-10-28 at 16 20 51@2x

@jackmcdade
Copy link
Member

And this error too https://flareapp.io/share/w5BrwnL5

@duncanmcclean
Copy link
Member Author

This looks awesome! I can't review it though because checking this branch out gives me errors 🤔

Odd. Wanna 🍐 on it when you get in?

And this error too https://flareapp.io/share/w5BrwnL5

Just pushed up a fix for this.

cursor[bot]

This comment was marked as outdated.

@jackmcdade jackmcdade marked this pull request as ready for review October 29, 2025 21:44
@duncanmcclean duncanmcclean merged commit bbbb42f into master Oct 30, 2025
29 checks passed
@duncanmcclean duncanmcclean deleted the previews branch October 30, 2025 10:00
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.

3 participants