Pequenio/php/home.php
sergiotarxz 5d3f40cd4a fix: Making article url appear always on article footer.
So pages which you don't want to have title won't have a big permalink.

Issue #2
2020-07-23 11:07:28 +02:00

45 lines
1.7 KiB
PHP

<!-- Section -->
<section class="content">
<?php foreach ($content as $page): ?>
<article class="page">
<header>
<?php if ( $page->title() ): ?>
<h2>
<a href="<?php echo htmlentities($page->permalink(), ENT_QUOTES | ENT_HTML401)?>">
<?php
echo htmlentities( $page->title() );
?>
</a>
</h2>
<?php endif; ?>
</header>
<?php if ($page->coverImage()): ?>
<img src="<?php echo $page->coverImage() ?>" alt="<?php echo $page->slug() ?>">
<?php endif ?>
<?php echo $page->content() ?>
<footer>
<a href="<?php echo htmlentities($page->permalink(), ENT_QUOTES | ENT_HTML401)?>">
<?php echo htmlentities( $L->get('Read this article.') ); ?>
</a>
<br/>
<?php echo $page->date() ?>
</footer>
</article>
<?php endforeach ?>
</section>
<!-- Pagination -->
<ul class="pagination">
<?php
if (Paginator::showPrev()) {
echo '<li class="float-left"><a href="'.Paginator::previousPageUrl().'">'.$L->get('Previous page').'</a></li>';
}
if (Paginator::showNext()) {
echo '<li class="float-right"><a href="'.Paginator::nextPageUrl().'">'.$L->get('Next page').'</a></li>';
}
?>
</ul>