SEO : add tombi mori plugin
This commit is contained in:
parent
df2843123f
commit
8f9e75126e
64 changed files with 3719 additions and 44 deletions
31
site/plugins/kirby-seo/blueprints/fields/og-image.php
Normal file
31
site/plugins/kirby-seo/blueprints/fields/og-image.php
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use Kirby\Cms\App;
|
||||
use Kirby\Toolkit\Str;
|
||||
|
||||
return function (App $kirby) {
|
||||
$blueprint = [
|
||||
'type' => 'files',
|
||||
'multiple' => false,
|
||||
'uploads' => [],
|
||||
'query' => Str::contains($kirby->path(), '/site') && !Str::contains($kirby->path(), 'pages') ? 'site.images' : 'page.images' // small hack to get context for field using api path
|
||||
];
|
||||
|
||||
if ($parent = option('tobimori.seo.files.parent')) {
|
||||
$blueprint['uploads'] = [
|
||||
'parent' => $parent
|
||||
];
|
||||
$blueprint['query'] = "{$parent}.images";
|
||||
}
|
||||
|
||||
if ($template = option('tobimori.seo.files.template')) {
|
||||
$blueprint['uploads'] = [
|
||||
...$blueprint['uploads'],
|
||||
'template' => $template
|
||||
];
|
||||
|
||||
$blueprint['query'] = "{$blueprint['query']}.filterBy('template', '{$template}')";
|
||||
}
|
||||
|
||||
return $blueprint;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue