chore: update kirby-seo plugin to v2.0.0-alpha.12
Update plugin from v1.1.2 to v2.0.0-alpha.12 for Kirby 5 compatibility. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
ff215de723
commit
04a14a7f1f
70 changed files with 6142 additions and 3 deletions
56
site/plugins/kirby-seo/blueprints/fields/robots.php
Normal file
56
site/plugins/kirby-seo/blueprints/fields/robots.php
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
use Kirby\Cms\App;
|
||||
use Kirby\Toolkit\A;
|
||||
use Kirby\Toolkit\Str;
|
||||
use tobimori\Seo\Meta;
|
||||
use tobimori\Seo\Seo;
|
||||
|
||||
return function (App $kirby) {
|
||||
if (!Seo::option('robots.active') || !Seo::option('robots.pageSettings')) {
|
||||
return [
|
||||
'type' => 'hidden'
|
||||
];
|
||||
}
|
||||
|
||||
$fields = [
|
||||
'_robotsHeadline' => [
|
||||
'label' => 'seo.fields.robots.label',
|
||||
'type' => 'headline',
|
||||
'numbered' => false,
|
||||
]
|
||||
];
|
||||
|
||||
$page = Meta::currentPage();
|
||||
foreach ($kirby->option('tobimori.seo.robots.types') as $robots) {
|
||||
$upper = Str::ucfirst($robots);
|
||||
|
||||
$fields["robots{$upper}"] = [
|
||||
'label' => "seo.fields.robots.{$robots}.label",
|
||||
'type' => 'toggles',
|
||||
'help' => "seo.fields.robots.{$robots}.help",
|
||||
'width' => '1/2',
|
||||
'default' => 'default',
|
||||
'reset' => false,
|
||||
'options' => [
|
||||
'default' => $page ?
|
||||
A::join([
|
||||
t('seo.common.default'),
|
||||
$page->metadata()->get("robots{$upper}", ['fields'])->toBool() ? t('seo.common.yes') : t('seo.common.no')
|
||||
], ' ')
|
||||
: t('seo.common.default'),
|
||||
'true' => t('seo.common.yes'),
|
||||
'false' => t('seo.common.no'),
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
$fields['_seoLine3'] = [
|
||||
'type' => 'line'
|
||||
];
|
||||
|
||||
return [
|
||||
'type' => 'group',
|
||||
'fields' => $fields,
|
||||
];
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue