Hi all,
I use SiteMeta to get a sitemap.xml and have excluded some pages by template. that works fine.
i also would like to exclude all unlisted pages
.
i did several attemps to config the plugin. none is working. i get some type errors.
does anyone know, what is the right way to add all unlisted pages
to the exclude.pages-array?
is it even possible to access site() in config?
'meta' => [
'exclude' => [
//'pages' => site()->index()->unlisted(),
'pages' => site()->index()->unlisted()->toArray(),
//'pages' => 'site()->index()->unlisted()->toArray,
'templates' => [
'default',
'error',
'xyz'
]
]
],
as a workaround i just add listed to the foreach inside the plugin. that works,
but i don’t like to override the plugin itself, to still be able to require that by composer.
//foreach (site()->index() as $item) {
foreach (site()->index()->listed() as $item) {
if (in_array($item->intendedTemplate()->name(), $excludeTemplates)) {
continue;
}
Thx!