Rewrite for Kirby

This commit is contained in:
Marcel Kapfer 2024-03-17 22:34:51 +01:00
parent 07201d05de
commit f854d60108
Signed by: mmk2410
GPG key ID: CADE6F0C09F21B09
116 changed files with 4156 additions and 8875 deletions

17
site/controllers/blog.php Normal file
View file

@ -0,0 +1,17 @@
<?php
return function ($page, $tag, $category) {
$articles = $page->children()->listed();
if ($tag) {
$articles = $articles->filterBy('tags', $tag, ',');
}
if ($category) {
$articles = $articles->filterBy('categories', $category, ',');
}
return [
'articles' => $articles->flip()->paginate(20)
];
};

View file

@ -0,0 +1,7 @@
<?php
return function ($page) {
return [
'quotes' => $page->children()->listed()->flip()->paginate(20)
];
};