Kotsu icon indicating copy to clipboard operation
Kotsu copied to clipboard

Hide pages

Open ArmorDarks opened this issue 7 years ago • 0 comments

"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:

  1. Page becomes completely inaccessible, even for developers, which isn't always right
  2. 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:

  1. getPage will filter all pages with hide property, unless said not to. This will prevent pages from appearing in unexpected places, like posts lists
  2. 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.

ArmorDarks avatar Jun 19 '17 15:06 ArmorDarks