Add Open Graph tags functionality
This commit is contained in:
parent
6879fad5fb
commit
875408a27c
2 changed files with 27 additions and 0 deletions
|
|
@ -141,6 +141,15 @@ switch ($parsedPath['type']) {
|
|||
$pageCss = findPageCss($dir, $ctx->contentDir);
|
||||
$pageCssUrl = $pageCss['url'] ?? null;
|
||||
$pageCssHash = $pageCss['hash'] ?? null;
|
||||
|
||||
// Check for cover image for social media
|
||||
$coverImage = findCoverImage($dir);
|
||||
$socialImageUrl = null;
|
||||
if ($coverImage) {
|
||||
$relativePath = str_replace($ctx->contentDir, '', $dir);
|
||||
$relativePath = trim($relativePath, '/');
|
||||
$socialImageUrl = '/' . ($relativePath ? $relativePath . '/' : '') . $coverImage;
|
||||
}
|
||||
|
||||
include $ctx->templates->base;
|
||||
exit;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue