caelum-bludit-theme/php/home.php

98 lines
3.3 KiB
PHP
Raw Normal View History

2024-08-17 17:30:35 +02:00
<main id="skip" class="fullwidth">
<?php Theme::plugins('pageBegin'); ?>
<div class="previews-section preview-grid">
<?php foreach ($content as $page): ?>
<article class="card">
<header>
<h2><a href="<?php echo $page->permalink(); ?>"><?php echo $page->title(); ?></a></h2>
<div class="flex">
<div>
<span>
<a class="badge" href="<?php echo $page->categoryPermalink(); ?>">
<svg class="icon" alt="">
<use xlink:href="#icon-folder"></use>
</svg>
&nbsp;<?php echo $page->category(); ?>
</a>
</span>
<?php
foreach ($page->tags(true) as $x => $y) {
?>
<span>
<a class="badge" href="<?php
$tagObject = new Tag($x);
echo print_r($tagObject->permalink());
?>" class="btn btn-small c-secondary">
<svg class="icon" alt="">
<use xlink:href="#icon-tags"></use>
</svg>
&nbsp;<?php echo $y; ?>
</a>
</span>
<?php
}
?>
</div>
<div>
<?php if (!$page->isStatic() && !$url->notFound()): ?>
<span class="badge">
<?php echo $page->date('j/m/Y') ?>
</span>
<span class="badge">
<?php echo $page->readingTime() ?>
</span>
<?php endif ?>
</div>
</div>
</header>
<?php if ($page->coverImage()): ?>
<div class="preview-thumbnail"> <img alt="" src="<?php echo $page->coverImage(); ?>" /> </div>
<?php endif ?>
<div class="preview-excerpt" aria-excerpt="true"><?php echo $page->content(); ?></div>
</article>
<?php endforeach ?>
</div>
<!-- Pagination -->
<?php if (Paginator::numberOfPages() > 1): ?>
<nav class="paginator mb-2 mt-1">
<ul class="pagination flex-that no-pills">
<!-- Previous button -->
<?php if (Paginator::showPrev()): ?>
<li class="page-item m-0 p-0">
<a class="page-link btn btn-primary m-0" href="<?php echo Paginator::previousPageUrl() ?>"
tabindex="-1"><?php echo $L->get('Previous'); ?></a>
</li>
<?php else: ?>
<li class="page-item m-0 p-0">
<span class="page-link m-0" tabindex="-1"><?php echo $L->get('Previous'); ?></span>
</li>
<?php endif; ?>
<!-- Home button -->
<li class="page-item p-0 m-0">
<span>Page <?php echo Paginator::currentPage(); ?> sur <?php echo Paginator::numberOfPages(); ?> </span>
</li>
<!-- Next button -->
<?php if (Paginator::showNext()): ?>
<li class="page-item m-0 p-0">
<a class="page-link btn btn-primary m-0"
href="<?php echo Paginator::nextPageUrl() ?>"><?php echo $L->get('Next'); ?></a>
</li>
<?php else: ?>
<li class="page-item m-0 p-0">
<span class="page-link m-0" tabindex="-1"><?php echo $L->get('Next'); ?> </span>
</li>
<?php endif; ?>
</ul>
</nav>
<?php endif ?>
</main>