-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
44 lines (34 loc) · 1.5 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
@include_once __DIR__ . '/vendor/autoload.php';
Kirby::plugin('hashsandsalt/kirby4-seo', [
'snippets' => [
'seo/meta' => __DIR__ . '/snippets/meta.php',
'seo/favicon' => __DIR__ . '/snippets/favicon.php'
],
'blueprints' => [
'tabs/seo/contact' => __DIR__ . '/blueprints/tabs/contact.yml',
'tabs/seo/meta' => __DIR__ . '/blueprints/tabs/meta.yml',
'fields/seo/meta' => __DIR__ . '/blueprints/fields/meta.yml'
],
'controllers' => [
'seo' => function ($page, $kirby, $site) {
return [
// Meta
'metatitle' => $page->title(),
'metadesc' => $page->seometa(),
'metakeywords' => $page->seotags(),
'metarobots' => 'index, follow, noodp',
'metaurl' => $page->url(),
'metaimage' => $page->shareimage()->toFile() ? $page->shareimage()->toFile()->crop(1280, 720)->url() : '',
// Facebook Meta
'metafbtype' => 'website',
'metafbsitename' => $site->title(),
'metafblocale' => 'en_GB',
// Twitter Meta
'metatwcard' => 'summary_large_image',
'metatwsite' => $site->socialtwitterurl()->isNotEmpty() ? $site->socialtwitterurl() : '',
'metatwcreator' => $site->twittercreator()->isNotEmpty() ? $site->twittercreator() : '',
];
}
]
]);