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
52
site/plugins/kirby-seo/snippets/prompts/tasks/alt-text.php
Normal file
52
site/plugins/kirby-seo/snippets/prompts/tasks/alt-text.php
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
/** @var \Kirby\Cms\File $file
|
||||
** @var \Kirby\Cms\Site $site
|
||||
** @var string|null $instructions
|
||||
** @var array<string>|null $languages */ ?>
|
||||
|
||||
<role>
|
||||
You are an accessibility expert writing alt text for images on <?= $site->title() ?>.
|
||||
</role>
|
||||
|
||||
<rules>
|
||||
- Be brief. One short sentence is ideal. Two sentences maximum, only if truly needed.
|
||||
- Start directly with the subject — NO introductory phrases like "Image of", "Photo of", "Shows", "Displays", "Depicts", "Contains", "Features", or similar prefixes.
|
||||
- Describe the meaning and purpose, not visual details. For example, "Logo of Mastercard" instead of "Two overlapping circles in orange and red".
|
||||
- DO NOT enumerate individual UI elements, icons, colors, or positions. Focus on the overall subject.
|
||||
- Do not add a trailing period to short noun phrases. Only use periods for full sentences.
|
||||
- NEVER output any formatting. No HTML tags, no quotes, no markdown.
|
||||
<?php if (!empty($languages)) : ?>
|
||||
- Output one line per language in the format <langcode>: <alt text>
|
||||
- Do NOT translate proper nouns, brand names, or technical terms.
|
||||
- Output ONLY the language lines. No additional text.
|
||||
<?php else : ?>
|
||||
- You MUST only output the alt text without additional prose, quotes, or introduction.
|
||||
- The output language MUST be <language><?= $site->lang() ?></language>.
|
||||
<?php endif ?>
|
||||
</rules>
|
||||
|
||||
<?php if (isset($instructions) && $instructions !== null && $instructions !== '') : ?>
|
||||
<user-instructions>
|
||||
<?= $instructions ?>
|
||||
</user-instructions>
|
||||
<?php endif ?>
|
||||
|
||||
<task>
|
||||
Write descriptive alt text for the attached image.
|
||||
|
||||
The file is named <filename><?= $file->filename() ?></filename>.
|
||||
|
||||
<?php if ($file->parent() instanceof \Kirby\Cms\Page) : ?>
|
||||
The image is on a page called <page-title><?= $file->parent()->title() ?></page-title>.
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($file->template()) : ?>
|
||||
This image uses the file template <template><?= $file->template() ?></template>.
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (!empty($languages)) : ?>
|
||||
Output alt text in these languages: <?= implode(', ', $languages) ?>
|
||||
|
||||
<?php endif ?>
|
||||
</task>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
/** @var \Kirby\Cms\Page $page
|
||||
** @var \Kirby\Cms\Site $site
|
||||
** @var string|null $instructions
|
||||
** @var string|null $edit */
|
||||
|
||||
$meta = $page->metadata();
|
||||
|
||||
snippet('seo/prompts/introduction', [
|
||||
'instructions' => $instructions ?? null,
|
||||
'edit' => $edit ?? null
|
||||
]); ?>
|
||||
|
||||
<task>
|
||||
Create a useful meta description for this page called <page-title><?= $page->title()->value() ?></page-title>. <?php if ($page->isHomePage()) : ?>This page is the homepage of the website.<?php endif ?>
|
||||
|
||||
The entire meta description SHOULD be between 120 and 158 characters long.
|
||||
|
||||
You'll receive the content of the page as well as any meta tags that are already set below.
|
||||
</task>
|
||||
|
||||
<?php snippet('seo/prompts/meta', ['currentField' => 'metaDescription']);
|
||||
snippet('seo/prompts/content');
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
/** @var \Kirby\Cms\Page $page
|
||||
** @var \Kirby\Cms\Site $site
|
||||
** @var string|null $instructions
|
||||
** @var string|null $edit */
|
||||
|
||||
$meta = $page->metadata();
|
||||
|
||||
snippet('seo/prompts/introduction', [
|
||||
'instructions' => $instructions ?? null,
|
||||
'edit' => $edit ?? null
|
||||
]); ?>
|
||||
|
||||
<task>
|
||||
Create a useful open graph description for this page called <page-title><?= $page->title()->value() ?></page-title>. <?php if ($page->isHomePage()) : ?>This page is the homepage of the website.<?php endif ?>
|
||||
This description will be shown on social media platforms like Facebook, WhatsApp and LinkedIn.
|
||||
|
||||
The entire meta description SHOULD be between 120 and 158 characters long.
|
||||
|
||||
You'll receive the content of the page as well as any meta tags that are already set below.
|
||||
</task>
|
||||
|
||||
<?php snippet('seo/prompts/meta', ['currentField' => 'ogDescription']);
|
||||
snippet('seo/prompts/content');
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
/** @var \Kirby\Cms\Page $page
|
||||
** @var \Kirby\Cms\Site $site
|
||||
** @var string|null $instructions
|
||||
** @var string|null $edit */
|
||||
|
||||
snippet('seo/prompts/introduction', [
|
||||
'instructions' => $instructions ?? null,
|
||||
'edit' => $edit ?? null
|
||||
]); ?>
|
||||
|
||||
<task>
|
||||
Create a useful GLOBAL open graph description for this site <site-title><?= $site->title()->value() ?>.</site-title>
|
||||
This description will be shown on social media platforms like Facebook, WhatsApp and LinkedIn.
|
||||
This description is meant as FALLBACK for when the page does not have a meta description itself.
|
||||
This description should be unique and relevant to the site's content.
|
||||
|
||||
The entire meta description SHOULD be between 120 and 158 characters long.
|
||||
|
||||
You'll receive the content of the home page as well as any meta tags that are already set below.
|
||||
</task>
|
||||
|
||||
<?php snippet('seo/prompts/site-meta', ['currentField' => 'ogDescription']);
|
||||
snippet('seo/prompts/content'); ?>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
/** @var \Kirby\Cms\Page $page
|
||||
** @var \Kirby\Cms\Site $site
|
||||
** @var string|null $instructions
|
||||
** @var string|null $edit */
|
||||
|
||||
snippet('seo/prompts/introduction', [
|
||||
'instructions' => $instructions ?? null,
|
||||
'edit' => $edit ?? null
|
||||
]); ?>
|
||||
|
||||
<task>
|
||||
Create a useful GLOBAL meta description for this site <site-title><?= $site->title()->value() ?>.</site-title>
|
||||
This description is meant as FALLBACK for when the page does not have a meta description itself.
|
||||
This description should be unique and relevant to the site's content.
|
||||
|
||||
The entire meta description SHOULD be between 120 and 158 characters long.
|
||||
|
||||
You'll receive the content of the home page as well as any meta tags that are already set below.
|
||||
</task>
|
||||
|
||||
<?php snippet('seo/prompts/site-meta', ['currentField' => 'metaDescription']);
|
||||
snippet('seo/prompts/content'); ?>
|
||||
39
site/plugins/kirby-seo/snippets/prompts/tasks/title.php
Normal file
39
site/plugins/kirby-seo/snippets/prompts/tasks/title.php
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
use Kirby\Toolkit\Str;
|
||||
|
||||
/** @var \Kirby\Cms\Page $page
|
||||
** @var \Kirby\Cms\Site $site
|
||||
** @var string|null $instructions
|
||||
** @var string|null $edit */
|
||||
|
||||
$meta = $page->metadata();
|
||||
|
||||
snippet('seo/prompts/introduction', [
|
||||
'instructions' => $instructions ?? null,
|
||||
'edit' => $edit ?? null
|
||||
]); ?>
|
||||
|
||||
<task>
|
||||
Create a useful meta title for this page called <page-title><?= $page->title()->value() ?></page-title>. <?php if ($page->isHomePage()) : ?>This page is the homepage of the website. AVOID an overly generic title such as 'Home'.<?php endif ?>
|
||||
|
||||
<?php if ($page->useTitleTemplate()->isEmpty() ? true : $page->useTitleTemplate()->toBool()):
|
||||
$template = $meta->get('metaTemplate');
|
||||
$templatePreview = $page->toString($template, ['title' => '{{ title }}']);
|
||||
$templateBaseLength = Str::length($page->toString($template, ['title' => '']));
|
||||
?>
|
||||
The final page title will be rendered as:
|
||||
|
||||
<template><?= $templatePreview ?></template>
|
||||
|
||||
Where {{ title }} is your page title. The entire title SHOULD be between <?= max(0, 50 - $templateBaseLength) ?>-<?= max(max(0, 50 - $templateBaseLength), 60 - $templateBaseLength) ?> characters long.
|
||||
DO NOT output the Title Template. ONLY output what should be placed inside {{ title }}. DO NOT repeat ANYTHING that exists in the template. You MUST NOT repeat the name of the site.
|
||||
<?php else: ?>
|
||||
Your response will be set as title without any changes. The entire title SHOULD be between 50-60 characters long.
|
||||
<?php endif; ?>
|
||||
|
||||
If useful for the customers niche, include a keyword for the location. AVOID for global companies or niche subpages.
|
||||
</task>
|
||||
|
||||
<?php snippet('seo/prompts/meta', ['currentField' => 'metaTitle']);
|
||||
snippet('seo/prompts/content');
|
||||
Loading…
Add table
Add a link
Reference in a new issue