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
This commit is contained in:
sergiotarxz 2020-07-23 11:07:28 +02:00
parent f096f2f6e6
commit 5d3f40cd4a
1 changed files with 7 additions and 1 deletions

View File

@ -3,13 +3,15 @@
<?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() ? $page->title() : $page->permalink() );
echo htmlentities( $page->title() );
?>
</a>
</h2>
<?php endif; ?>
</header>
<?php if ($page->coverImage()): ?>
<img src="<?php echo $page->coverImage() ?>" alt="<?php echo $page->slug() ?>">
@ -18,6 +20,10 @@
<?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>