✨ Rewrite for Kirby
This commit is contained in:
parent
07201d05de
commit
f854d60108
116 changed files with 4156 additions and 8875 deletions
17
site/controllers/blog.php
Normal file
17
site/controllers/blog.php
Normal 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)
|
||||
];
|
||||
};
|
7
site/controllers/quotes.php
Normal file
7
site/controllers/quotes.php
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
return function ($page) {
|
||||
return [
|
||||
'quotes' => $page->children()->listed()->flip()->paginate(20)
|
||||
];
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue