index(true)->filterBy('intendedTemplate', 'in', [ 'person', 'organisation', 'document', 'place', ]); return array_values($collection->map(function ($page) { return $page->diruri(); })); }, 10 // expire in 10 minutes ); // use bolt from autoid/boost to get pages quickly $pages = array_map(function ($diruri) { return \Bnomei\Bolt::page($diruri); }, $cachedDirUris); // remove those that bolt did not find $pages = array_filter($pages, function ($page) { return is_null($page) ? false : true; }); $collectionFromDirUris = new \Kirby\Cms\Pages($pages); static::$cache = $collectionFromDirUris; return static::$cache; } } return function () { return PagesThatCanBeReferencedWithoutIndex::load(); };