Kotsu
Kotsu copied to clipboard
Hide pages
"Hiding" pages by adding _
in front of filename isn't always convenient, since it completely removes page from build. While sounding right, it has few issues:
- Page becomes completely inaccessible, even for developers, which isn't always right
- Any
getPage
calls which tried to access that page Matter Data will print warnings, since Gray Matter does not collect data from pages with leading_
.
As an alternative, we can add hide
property, which when set to true
will do following:
-
getPage
will filter all pages withhide
property, unless said not to. This will prevent pages from appearing in unexpected places, like posts lists - All such pages will be automatically added to
robots.txt
disallow
An alternative way is to allow Gray Matter collect data even from _
pages, but filter it out within getPage
and other accessing matter data functions. Well, that sounds not bad too, but it will, once again, completely remove page from build.