'#1f1f1f', 'dark' => '#1f1f1f', 'nord' => '#3b4252', 'dracula' => '#343746', 'catppuccin' => '#313244', ); $blowfishChrome = isset($blowfishChromeColors[$blowfishTheme]) ? $blowfishChromeColors[$blowfishTheme] : '#1f1f1f'; ?> coverImage()): ?> getValue($field); if (!$raw) { return ''; } if (class_exists('Date')) { $fmt = Date::format($raw, DB_DATE_FORMAT, 'c'); if ($fmt) { return $fmt; } } return $raw; } } if ($ogIsArticle) { $ogTitle = $page->title(); $ogDesc = $page->description(); $ogUrl = $page->permalink(true); $ogImage = $page->coverImage(true); $ogPublishedIso = blowfish_iso_date($page, 'date'); } else { $ogTitle = $site->title(); $ogDesc = ''; $ogUrl = Theme::siteUrl(); $ogImage = ''; } // Fallbacks if (!$ogDesc) { $ogDesc = $site->description() ?: $site->slogan(); } if (!$ogImage) { $ogImage = DOMAIN_THEME . 'img/spleenftw.jpeg'; } $ogType = $ogIsArticle ? 'article' : 'website'; $ogSiteName = $site->title(); ?> ' . json_encode($doc, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . '' . "\n"; }; // Social profile URLs, used as schema.org "sameAs". $blowfishSameAs = array(); foreach (Theme::socialNetworks() as $snKey => $snLabel) { $snUrl = $site->{$snKey}(); if (!empty($snUrl)) { $blowfishSameAs[] = $snUrl; } } // WebSite (every page) — declares the site + a sitelinks search box. $siteLd = array( '@context' => 'https://schema.org', '@type' => 'WebSite', 'name' => blowfish_plain($site->title()), 'url' => Theme::siteUrl(), ); $siteDesc = $site->description() ?: $site->slogan(); if ($siteDesc) { $siteLd['description'] = blowfish_plain($siteDesc); } $siteLd['potentialAction'] = array( '@type' => 'SearchAction', 'target' => array( '@type' => 'EntryPoint', 'urlTemplate' => rtrim(Theme::siteUrl(), '/') . '/search/{search_term_string}', ), 'query-input' => 'required name=search_term_string', ); $blowfishEmitLd($siteLd); // BlogPosting + BreadcrumbList — articles only. if ($ogIsArticle) { $ldDescription = $page->description() ?: ($site->description() ?: $site->slogan()); $ldImage = $page->coverImage(true) ?: (DOMAIN_THEME . 'img/spleenftw.jpeg'); $ldPublished = $ogPublishedIso; // dateModified: fall back to published date when not tracked. $ldModified = blowfish_iso_date($page, 'dateModified'); if (!$ldModified) { $ldModified = $ldPublished; } // timeRequired as an ISO 8601 duration (e.g. "PT8M") parsed from readingTime(). $ldTimeRequired = ''; if (preg_match('/\d+/', $page->readingTime(), $rtMatch)) { $ldTimeRequired = 'PT' . $rtMatch[0] . 'M'; } $author = array( '@type' => 'Person', 'name' => blowfish_plain($page->username()), 'url' => Theme::siteUrl(), ); if (!empty($blowfishSameAs)) { $author['sameAs'] = $blowfishSameAs; } $jsonLd = array( '@context' => 'https://schema.org', '@type' => 'BlogPosting', 'headline' => blowfish_plain($page->title()), 'description' => blowfish_plain($ldDescription), 'image' => $ldImage, 'datePublished' => $ldPublished, 'dateModified' => $ldModified, 'author' => $author, 'publisher' => array( '@type' => 'Organization', 'name' => blowfish_plain($site->title()), 'logo' => array( '@type' => 'ImageObject', 'url' => DOMAIN_THEME . 'img/favicon.png', ), ), 'mainEntityOfPage' => array( '@type' => 'WebPage', '@id' => $page->permalink(true), ), 'wordCount' => str_word_count(strip_tags($page->content())), ); if ($ldTimeRequired) { $jsonLd['timeRequired'] = $ldTimeRequired; } $blowfishEmitLd($jsonLd); // Breadcrumb: Home > [Category] > Article $crumbs = array(array( '@type' => 'ListItem', 'position' => 1, 'name' => blowfish_plain($site->title()), 'item' => Theme::siteUrl(), )); $pos = 2; if ($page->categoryKey()) { $crumbs[] = array( '@type' => 'ListItem', 'position' => $pos++, 'name' => blowfish_plain($page->category()), 'item' => $page->categoryPermalink(), ); } $crumbs[] = array( '@type' => 'ListItem', 'position' => $pos, 'name' => blowfish_plain($page->title()), 'item' => $page->permalink(true), ); $blowfishEmitLd(array( '@context' => 'https://schema.org', '@type' => 'BreadcrumbList', 'itemListElement' => $crumbs, )); } ?> / / $bdPluginHead = preg_replace('/]*\b(?:property|name)=["\'](?:og:|twitter:|article:)[^"\']*["\'][^>]*>\s*/i', '', $bdPluginHead); // duplicate $bdPluginHead = preg_replace('/]*\brel=["\']canonical["\'][^>]*>\s*/i', '', $bdPluginHead); echo $bdPluginHead; ?>