Add page template with metadata display and copyright translation
Add support for language translations in footer Add page template to template resolution logic
This commit is contained in:
parent
19bb105303
commit
d937ca6166
3 changed files with 122 additions and 64 deletions
|
|
@ -23,7 +23,7 @@
|
|||
<?= $content ?>
|
||||
</main>
|
||||
<footer>
|
||||
<p>© <?= date('Y') ?></p>
|
||||
<p>© <?= date('Y') ?> <?= htmlspecialchars($translations['footer_copyright'] ?? '') ?></p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
25
app/default/templates/page.php
Normal file
25
app/default/templates/page.php
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?= $content ?>
|
||||
|
||||
<?php if ($pageMetadata && (isset($pageMetadata['tags']) || isset($pageMetadata['categories']))): ?>
|
||||
<aside class="metadata">
|
||||
<?php if (!empty($pageMetadata['categories'])): ?>
|
||||
<div class="categories">
|
||||
<strong><?= htmlspecialchars($translations['categories'] ?? 'Categories') ?>:</strong>
|
||||
<?php
|
||||
$categories = array_map('trim', explode(',', $pageMetadata['categories']));
|
||||
echo implode(', ', array_map('htmlspecialchars', $categories));
|
||||
?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($pageMetadata['tags'])): ?>
|
||||
<div class="tags">
|
||||
<strong><?= htmlspecialchars($translations['tags'] ?? 'Tags') ?>:</strong>
|
||||
<?php
|
||||
$tags = array_map('trim', explode(',', $pageMetadata['tags']));
|
||||
echo implode(', ', array_map('htmlspecialchars', $tags));
|
||||
?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</aside>
|
||||
<?php endif; ?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue