|
<!--------------------------- |
|
archive.html |
|
Description: This code creates an archive in the style of Hugo's PaperMod theme. The design is your responsibility. |
|
|
|
Created by Robert Pfotenhauer on 26.10.23. |
|
----------------------------> |
|
|
|
<?php $this->yellow->layout("header") ?> |
|
|
|
<h1><?php echo $this->yellow->page->getHtml("titleContent") ?></h1> |
|
<?php echo $this->yellow->page->getContentHtml() ?> |
|
|
|
<?php $pages = $this->yellow->content->index()->filter("layout", "blog")->sort("published", false) ?> |
|
<?php $this->yellow->page->setLastModified($pages->getModified()) ?> |
|
|
|
<?php foreach ($pages->group("published", false, "Y") as $year=>$collectionYear): ?> |
|
<div class="archive-year"> |
|
<h2><?php echo htmlspecialchars($year) ?> <sup class="archive-count">(<?php echo count($collectionYear) ?>)</sup></h2> |
|
|
|
<?php foreach ($collectionYear->group("published", false, "F") as $month=>$collectionMonth): ?> |
|
<div class="archive-month"> |
|
<div class="archive-month__header"> |
|
<strong><?php echo htmlspecialchars($this->yellow->lookup->normaliseDate($month)) ?> <sup class="archive-count">(<?php echo count($collectionMonth) ?>)</sup></strong> |
|
</div> |
|
|
|
<div class="archive-posts"> |
|
<?php foreach ($collectionMonth as $page): ?> |
|
<div class="archive-entry"> |
|
<?php echo $page->getHtml("title") ?> |
|
<div class="archive-meta"> |
|
<?php echo $page->getDateHtml("published") ?> |
|
<?php echo " · " . $page->parseContentShortcut("readingtime", "", "inline") . " min"; ?> |
|
</div> |
|
<a class="entry-link" aria-label="<?php echo $page->getHtml("title") ?>" title="<?php echo $page->getHtml("title") ?>" href="<?php echo $page->getLocation(true) ?>"> </a> |
|
</div> |
|
<?php endforeach ?> |
|
</div> |
|
|
|
</div> |
|
<?php endforeach ?> |
|
|
|
</div> |
|
<?php endforeach ?> |
|
|
|
<?php $this->yellow->layout("footer") ?> |