'#1f1f1f', 'dark' => '#1f1f1f', 'nord' => '#3b4252', 'dracula' => '#343746', 'catppuccin' => '#313244', ); $blowditChrome = isset($blowditChromeColors[$blowditTheme]) ? $blowditChromeColors[$blowditTheme] : '#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 = blowdit_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(); ?> 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 = blowdit_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'; } $jsonLd = array( '@context' => 'https://schema.org', '@type' => 'BlogPosting', 'headline' => blowdit_plain($page->title()), 'description' => blowdit_plain($ldDescription), 'image' => $ldImage, 'datePublished' => $ldPublished, 'dateModified' => $ldModified, 'author' => array( '@type' => 'Person', 'name' => blowdit_plain($page->username()), 'url' => Theme::siteUrl(), ), 'publisher' => array( '@type' => 'Organization', 'name' => blowdit_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; } echo '' . "\n"; } ?>