1. Go to this page and download the library: Download fabianmichael/kirby-meta library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
fabianmichael / kirby-meta example snippets
<!doctype html>
<html>
<head>
snippet('meta')
return [
'meta.load:after' => function (
array $metadata,
Kirby\Cms\Page $page,
?string $languageCode
) {
// set `thumbnail.png` as default share image for all pages,
// if not other image was already set by a page model
if (empty($metadata['og_image']) === true) {
$metadata['og_image'] = $page->image('thumbnail.png');
}
return $metadata;
},
];