getgrav / grav-plugin-sitemap

Grav Sitemap Plugin
https://getgrav.org
MIT License
42 stars 42 forks source link

Ignore not visible pages #75

Closed zouloux closed 4 years ago

zouloux commented 4 years ago

Hi, and first of all, thanks for this very useful plugin :)

I always add this behavior to the plugin : Ignore pages which are not visible. It's very useful to me because when you hide a page in Grav, this is basically to be able to edit it and preview it from the admin. What do you think about it ?

To enable this behavior, I just added this line : if ( isset($header->visible) && !$header->visible ) $page_ignored = true; In sitemap.php after line 76.

It may be more useful to add an option to the blueprint.

Thanks

rhukster commented 4 years ago

Visible only means it should not show in the menu, so that does not mean it's not 'reachable' or not important enough for the sitemap.

The proper way to be able to edit a page but not have it show on the site, or in the sitemap is to simply set "Published" to No.

zouloux commented 4 years ago

Hi @rhukster, thanks a lot for your answer. I got to this conclusion because I can't preview an unpublished page (the eye icon is hidden when Published is set to No). I'll search more info on this. Thanks

rhukster commented 4 years ago

It is true you cannot preview it as if it were on the frontend, but there is a quick preview in the editor.