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): ?> <?php foreach ($content as $page): ?>
<article class="page"> <article class="page">
<header> <header>
<?php if ( $page->title() ): ?>
<h2> <h2>
<a href="<?php echo htmlentities($page->permalink(), ENT_QUOTES | ENT_HTML401)?>"> <a href="<?php echo htmlentities($page->permalink(), ENT_QUOTES | ENT_HTML401)?>">
<?php <?php
echo htmlentities($page->title() ? $page->title() : $page->permalink() ); echo htmlentities( $page->title() );
?> ?>
</a> </a>
</h2> </h2>
<?php endif; ?>
</header> </header>
<?php if ($page->coverImage()): ?> <?php if ($page->coverImage()): ?>
<img src="<?php echo $page->coverImage() ?>" alt="<?php echo $page->slug() ?>"> <img src="<?php echo $page->coverImage() ?>" alt="<?php echo $page->slug() ?>">
@ -18,6 +20,10 @@
<?php echo $page->content() ?> <?php echo $page->content() ?>
<footer> <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() ?> <?php echo $page->date() ?>
</footer> </footer>
</article> </article>