Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 23 lines (16 sloc) 459 Bytes
<?php
return function($page) {
$categories = $page->children()->listed();
$recipes = $categories->children()->listed();
if ($category = get('category')) {
$recipes = $page->recipes($category);
}
if (get('new')) {
$recipes = $page->grandChildren()->filterBy('isNew', true);
}
return [
'recipes' => $recipes->sortBy('title', 'asc'),
'categories' => $categories,
'category' => $categories->find($category)
];
};
You can’t perform that action at this time.