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
40
site/plugins/kirby-seo/classes/Ai/Driver.php
Normal file
40
site/plugins/kirby-seo/classes/Ai/Driver.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace tobimori\Seo\Ai;
|
||||
|
||||
use Generator;
|
||||
use Kirby\Exception\InvalidArgumentException;
|
||||
use tobimori\Seo\Seo;
|
||||
|
||||
abstract class Driver
|
||||
{
|
||||
public function __construct(protected string $providerId)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Streams a response for the given content.
|
||||
*
|
||||
* @param array<Content> $content Array of Content messages forming a conversation.
|
||||
* @param string|null $model Model override.
|
||||
*
|
||||
* @return Generator<int, Chunk, mixed, void>
|
||||
*/
|
||||
abstract public function stream(array $content, string|null $model = null): Generator;
|
||||
|
||||
/**
|
||||
* Returns a configuration value or throws when required.
|
||||
*/
|
||||
protected function config(string $key, mixed $default = null, bool $required = false): mixed
|
||||
{
|
||||
$value = Seo::option("ai.providers.{$this->providerId}.config.{$key}", $default);
|
||||
|
||||
if ($required === true && ($value === null || $value === '')) {
|
||||
throw new InvalidArgumentException(
|
||||
"Missing required \"{$key}\" configuration for driver " . static::class . '.'
|
||||
);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue