Closed michaellindahl closed 3 years ago
So I found a better way of doing this. Previously I was doing:
->filter(function ($entry) {
return ! is_null($entry->collection()->routes()->get('default'));
})
However, I just realized that Entries are Routable
which has a uri()
method which returns null when $this->route()
doesn't have a value. This seem like the proper solution for Entries. So now I'm doing this:
->reject(function ($entry) {
return is_null($entry->uri());
})
Term
s always have a slug associated with them, which leads me to believe that the urls
/terms
/scopedTerms
do not need this treatment.
Sorry for the delay. Thanks for the PR!
This fixes #26 and fixes #27 where entries without routes are generated overriding the homepage and excessively generating files. I'm unsure this should also be applied to
urls
/terms
/scopedTerms
and if there's a better approach than the one taken here.