Files
bludit-blowfish/php/home.php
T
interlope 29a28ce6d7 Add inline SVG icons for UI and theme picker
This commit introduces a new PHP file `icons.php` that defines a set of inline SVG icons to replace the Bootstrap Icons webfont. The icons include common UI elements such as calendar, clock, folder, and tag, as well as theme picker icons like sun, moon, snow, droplet, cup, and half. The SVGs are designed to scale with existing font-size rules and are accessible via the `blowdit_icon` function. Additionally, a mapping function `blowdit_theme_icon` is provided to associate theme keys with their corresponding icon names.
2026-06-02 00:08:11 +02:00

119 lines
4.7 KiB
PHP

<?php
// ---- Profile hero (Blowfish-style) -------------------------------------
// Shown only on the blog front page (first paginated page).
// Drop your avatar at img/spleenftw.jpeg (change the filename below to reuse).
$profileImage = DOMAIN_THEME . 'img/spleenftw.jpeg';
$showProfile = ($WHERE_AM_I === 'home' && Paginator::currentPage() == 1);
?>
<?php if ($showProfile) : ?>
<header class="profile text-center">
<img class="profile-avatar" src="<?php echo $profileImage; ?>" alt="<?php echo htmlspecialchars($site->title(), ENT_QUOTES, 'UTF-8'); ?>" />
<h1 class="profile-name"><?php echo htmlspecialchars($site->title(), ENT_QUOTES, 'UTF-8'); ?></h1>
<?php if ($site->slogan()) : ?>
<p class="profile-bio"><?php echo htmlspecialchars($site->slogan(), ENT_QUOTES, 'UTF-8'); ?></p>
<?php elseif ($site->description()) : ?>
<p class="profile-bio"><?php echo htmlspecialchars($site->description(), ENT_QUOTES, 'UTF-8'); ?></p>
<?php endif ?>
<?php $networks = Theme::socialNetworks(); ?>
<?php if (!empty($networks)) : ?>
<div class="profile-social">
<?php foreach ($networks as $key => $label) : ?>
<a href="<?php echo $site->{$key}(); ?>" target="_blank" rel="noopener" title="<?php echo htmlspecialchars($label, ENT_QUOTES, 'UTF-8') ?>">
<img class="profile-social-icon" src="<?php echo DOMAIN_THEME . 'img/' . $key . '.svg' ?>" alt="<?php echo htmlspecialchars($label, ENT_QUOTES, 'UTF-8') ?>" />
</a>
<?php endforeach ?>
</div>
<?php endif ?>
</header>
<!-- Search box, relocated from the sidebar (Popeye-style) -->
<?php if (!empty($sidebarSearchHtml)) : ?>
<div class="home-search">
<?php echo $sidebarSearchHtml; ?>
</div>
<?php endif ?>
<?php endif ?>
<?php if (empty($content)) : ?>
<div class="mt-5">
<?php $language->p('No pages found') ?>
</div>
<?php endif ?>
<!-- Post list (titles only) -->
<div class="post-list">
<?php foreach ($content as $page) : ?>
<article class="post-list-item">
<!-- Load Bludit Plugins: Page Begin -->
<?php Theme::plugins('pageBegin'); ?>
<div class="post-list-head">
<a href="<?php echo $page->permalink(); ?>">
<h2 class="post-list-title"><?php echo htmlspecialchars($page->title(), ENT_QUOTES, 'UTF-8'); ?></h2>
</a>
<div class="post-list-meta">
<span><?php echo blowdit_icon('calendar'); ?><?php echo $page->date(); ?></span>
<?php if (!$page->isStatic()) : ?>
<span><?php echo blowdit_icon('clock'); ?><?php echo $page->readingTime(); ?></span>
<?php endif ?>
</div>
</div>
<!-- Tags and Category -->
<?php $tagsList = $page->tags(true); $categoryKey = $page->categoryKey(); ?>
<?php if (!empty($tagsList) || $categoryKey) : ?>
<div class="post-taxonomy">
<?php if ($categoryKey) : ?>
<a class="taxonomy-badge" href="<?php echo $page->categoryPermalink(); ?>">
<?php echo blowdit_icon('folder'); ?><?php echo htmlspecialchars($page->category(), ENT_QUOTES, 'UTF-8'); ?>
</a>
<?php endif ?>
<?php foreach ($tagsList as $tagKey => $tagName) : ?>
<a class="taxonomy-badge" href="<?php echo DOMAIN_TAGS . $tagKey; ?>"><?php echo blowdit_icon('tag'); ?><?php echo htmlspecialchars($tagName, ENT_QUOTES, 'UTF-8'); ?></a>
<?php endforeach ?>
</div>
<?php endif ?>
<!-- Load Bludit Plugins: Page End -->
<?php Theme::plugins('pageEnd'); ?>
</article>
<?php endforeach ?>
</div>
<!-- Pagination -->
<?php if (Paginator::numberOfPages() > 1) : ?>
<nav class="paginator mt-5">
<ul class="pagination flex-wrap justify-content-center">
<!-- Previous button -->
<?php if (Paginator::showPrev()) : ?>
<li class="page-item mr-2">
<a class="page-link" href="<?php echo Paginator::previousPageUrl() ?>" tabindex="-1">
<?php echo blowdit_icon('chevron-left'); ?> <?php echo $L->get('Previous'); ?>
</a>
</li>
<?php endif; ?>
<!-- Home button -->
<li class="page-item mx-2 <?php if (Paginator::currentPage() == 1) echo 'disabled' ?>">
<a class="page-link" href="<?php echo Theme::siteUrl() ?>">
<?php echo blowdit_icon('house'); ?> Home
</a>
</li>
<!-- Next button -->
<?php if (Paginator::showNext()) : ?>
<li class="page-item ml-2">
<a class="page-link" href="<?php echo Paginator::nextPageUrl() ?>">
<?php echo $L->get('Next'); ?> <?php echo blowdit_icon('chevron-right'); ?>
</a>
</li>
<?php endif; ?>
</ul>
</nav>
<?php endif ?>