Advanced -> // Email account settings). Leave it to auto-detect, or hard-set $blowditEmail // below to override. Empty -> the icon is hidden. $blowditEmail = ''; if (isset($site)) { // Try Bludit's site settings (accessor is getValue(); getField() as backup). $bdGet = method_exists($site, 'getValue') ? 'getValue' : (method_exists($site, 'getField') ? 'getField' : null); if ($bdGet) { $blowditEmail = $site->$bdGet('emailFromAddress'); // Bludit's "Sender email" if (empty($blowditEmail)) { $blowditEmail = $site->$bdGet('email'); } } } // Bludit's sender email isn't always exposed to themes (it's an SMTP/plugin // setting), so fall back to a fixed address. Set to '' to hide the icon. if (empty($blowditEmail)) { $blowditEmail = 'contact@interlope.xyz'; } $blowditTwitterHandle = '@spleenftw'; // twitter:site / twitter:creator; '' to omit // Read the theme from a cookie so the root element can be rendered // pre-coloured. This paints the page in the theme colour from the first // byte of every response, eliminating the white flash between navigations. $blowditThemeBg = array( 'light' => '#ffffff', 'dark' => '#171717', 'nord' => '#2e3440', 'dracula' => '#282a36', 'catppuccin' => '#1e1e2e', ); $blowditTheme = (isset($_COOKIE['blowdit-theme']) && isset($blowditThemeBg[$_COOKIE['blowdit-theme']])) ? $_COOKIE['blowdit-theme'] : 'light'; $blowditBg = $blowditThemeBg[$blowditTheme]; $blowditScheme = ($blowditTheme === 'light') ? 'light' : 'dark'; // Pre-compute before so we can stamp the has-toc class on it, // which lets CSS align the navbar container with the wider article container. $blowditIsArticle = ($WHERE_AM_I === 'page' && isset($page) && !$page->isStatic() && !$url->notFound()); $blowditHasHeadings = $blowditIsArticle && (bool) preg_match('/content()); ?> > siteSidebar(); $isSearch = (strpos($out, 'plugin-search') !== false); $isNav = (strpos($out, 'plugin-navigation') !== false || strpos($out, 'plugin-pages') !== false); // Fixed sidebar order (lower = higher up). Unknown plugins such as // the Hit Counter default to 90, i.e. pinned to the bottom. $priority = 90; if (strpos($out, 'plugin-about') !== false) $priority = 10; // Blog / About elseif ($isSearch) $priority = 20; // Search elseif ($isNav) $priority = 30; // Navigation elseif (strpos($out, 'plugin-categories') !== false) $priority = 40; // Category if ($isSearch) { $sidebarSearchHtml .= $out; } // Mark the navigation / pages plugin so its list can be shuffled // client-side (see the script near the body end). if ($isNav) { $out = '
' . $out . '
'; } $sidebarItems[] = array( 'priority' => $priority, 'index' => $sidebarIndex++, 'search' => $isSearch, 'nav' => $isNav, 'html' => $out, ); } } // Stable sort by priority, then original order (PHP < 8 usort isn't stable). usort($sidebarItems, function ($a, $b) { if ($a['priority'] === $b['priority']) { return $a['index'] - $b['index']; } return $a['priority'] - $b['priority']; }); $sidebarFullHtml = ''; // all plugins, ordered (used on article/page views) $sidebarNoSearchHtml = ''; // same, minus search (kept for potential future use) $sidebarHomeHtml = ''; // about + categories + hit counter only (homepage, no nav/search) foreach ($sidebarItems as $item) { $sidebarFullHtml .= $item['html']; if (!$item['search']) { $sidebarNoSearchHtml .= $item['html']; } if (!$item['search'] && !$item['nav']) { $sidebarHomeHtml .= $item['html']; } } // The hero (and the relocated search) appear on every paginated home page. $heroVisible = ($WHERE_AM_I === 'home'); // Reuse the values pre-computed before (avoids calling $page->content() twice). $isArticlePage = $blowditIsArticle; $hasHeadings = $blowditHasHeadings; ?>