feat: intégration plugin Kirby SEO
All checks were successful
Deploy / Deploy to Production (push) Successful in 22s
All checks were successful
Deploy / Deploy to Production (push) Successful in 22s
- Ajout de tobimori/kirby-seo via Composer
- snippet('seo/head') dans header.php (remplace les meta manuels)
- snippet('seo/schemas') dans footer.php pour JSON-LD
- Onglet SEO ajouté dans site.yml et tous les blueprints de pages
- Configuration SEO dans config.php (sitemap, robots, canonicalBase TODO)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
baab2fb3a1
commit
58c31ea391
133 changed files with 9201 additions and 253 deletions
|
|
@ -0,0 +1,47 @@
|
|||
---
|
||||
title: Extending the Plugin
|
||||
intro: Replace built-in classes with your own
|
||||
---
|
||||
|
||||
Kirby SEO uses a component system similar to [Kirby's own](https://getkirby.com/docs/reference/plugins/components). Every major class in the plugin can be swapped out for a custom one. This lets you change how the plugin works without forking it.
|
||||
|
||||
The built-in components are:
|
||||
|
||||
| Key | Default class | Handles |
|
||||
| ---------- | ---------------------------------- | --------------------------------- |
|
||||
| `meta` | `tobimori\Seo\Meta` | Meta tag generation and cascading |
|
||||
| `ai` | `tobimori\Seo\Ai` | AI Assist provider management |
|
||||
| `indexnow` | `tobimori\Seo\IndexNow` | IndexNow ping requests |
|
||||
| `schema` | `tobimori\Seo\SchemaSingleton` | Schema.org structured data store |
|
||||
| `gsc` | `tobimori\Seo\GoogleSearchConsole` | Google Search Console integration |
|
||||
|
||||
To replace a component, create a class that extends the original. For example, to customize meta tag output, extend the `Meta` class:
|
||||
|
||||
```php
|
||||
<?php
|
||||
// site/plugins/my-seo/index.php
|
||||
|
||||
use tobimori\Seo\Meta;
|
||||
|
||||
class MyMeta extends Meta
|
||||
{
|
||||
// override any method you need
|
||||
}
|
||||
```
|
||||
|
||||
Then register your class in the config:
|
||||
|
||||
```php
|
||||
<?php
|
||||
// site/config/config.php
|
||||
|
||||
return [
|
||||
'tobimori.seo' => [
|
||||
'components' => [
|
||||
'meta' => MyMeta::class,
|
||||
],
|
||||
],
|
||||
];
|
||||
```
|
||||
|
||||
The rest of the plugin picks up your class automatically. Page methods, hooks, routes, and sections all resolve components through the config, so your class is used everywhere the original would have been. Look at the built-in classes in `site/plugins/kirby-seo/classes/` to see what methods are available to override.
|
||||
Loading…
Add table
Add a link
Reference in a new issue