johannschopplich / kirby-serp-preview
See the Google snippet as you type
Package info
github.com/johannschopplich/kirby-serp-preview
Type:kirby-plugin
pkg:composer/johannschopplich/kirby-serp-preview
Fund package maintenance!
Requires
- php: >=8.2
- getkirby/composer-installer: ^1
- johannschopplich/kirby-tools-utils: ^0.1
Requires (Dev)
- getkirby/cms: ^5
- phpunit/phpunit: ^12
- vlucas/phpdotenv: ^5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Kirby SERP Preview
Kirby SERP Preview is a plugin for Kirby CMS. It adds a Panel field that draws the Google result snippet for the page being edited β favicon, site name, URL, title, and description β and redraws it as you type, before anything is saved.
When to Use
| I want to⦠| Use |
|---|---|
| See a page's Google result snippet while I edit it | serp-preview field |
| Draw the snippet from my meta title and description fields | titleContentKey and descriptionContentKey |
| Shorten the snippet text the way my templates do | formatters option |
| Show the production host on a staging install | siteUrl |
Render the meta tags in a page's <head> |
The site's templates, or $page->meta() from Kirby Helpers |
| Run SEO and readability assessments on a page's content | Kirby SEO Audit |
Features
- π±οΈ One Field, Any Page: Add the field type to a page or site blueprint β there is nothing else to set up.
- β‘ Redraws as You Type: The snippet follows the open form rather than the saved content, and never writes back.
- π·οΈ Title and Description Fields: Name the fields it reads, each with a fallback for when they are empty.
- βοΈ Formatters: Trim or clean the text the way your templates do, so the snippet matches the live page.
- π§© Kirby Queries: Every property the snippet shows accepts
{{ ... }}, resolved against the current model. - π Search Console Link: An optional button in the field header, pointing at the URL you configure.
- π Light and Dark Mode: Google's own snippet colors, following the Panel theme.
Requirements
- Kirby 6
Installation
Composer (Recommended)
composer require johannschopplich/kirby-serp-preview
Manual Installation
Download a release and extract it to /site/plugins/kirby-serp-preview.
Upgrading from SERP Preview 1
SERP Preview 2 requires Kirby 6, which has no plugin sections, so the SERP Preview section is a field now. Kirby shows Invalid section type ("serp-preview") until you move it from sections: to fields:. Its options stay the same:
-sections: +fields: serpPreview: type: serp-preview descriptionContentKey: metaDescription
Options that take a query resolve as Kirby string templates, so single braces count as a query too: { site.title } resolves like {{ site.title }}, and a literal {β¦} in the value is replaced.
Documentation
For installation, configuration, and usage, see the Kirby SERP Preview documentation.
License
MIT License Β© 2023-PRESENT Johann Schopplich
MIT License Β© 2023 Dennis Baum