After chatting with @armanbilge about a PR to selectively exclude pages in indexing in the Typelevel site, we figured we should instead reuse Laika's HOCON configuration system instead of introducing a new one.
Desired behaviour
We introduce a namespaced ("protosearch") boolean configuration value, exclude, that defaults to false.
So the default behaviour is to index all documents in the Laika scope.
- A user can exclude a page from indexing by adding an entry to that page's HOCON config header.
{%
protosearch.exclude = true
%}
Document markup here...
- A user can exclude a directory from indexing by adding an entry to the directory.conf
directory.conf
protosearch.exclude = true
Notes
There is some related work in #347 for actually indexing HOCON values.
With this change you should probably still be able to programmatically exclude documents by interacting with the Config on the Document directly as per https://typelevel.org/Laika/latest/07-reference/02-substitution-variables.html#programmatic-access
It's not yet totally clear to me how much of #371 should be undone.
After chatting with @armanbilge about a PR to selectively exclude pages in indexing in the Typelevel site, we figured we should instead reuse Laika's HOCON configuration system instead of introducing a new one.
Desired behaviour
We introduce a namespaced ("protosearch") boolean configuration value,
exclude, that defaults tofalse.So the default behaviour is to index all documents in the Laika scope.
{% protosearch.exclude = true %} Document markup here...directory.confprotosearch.exclude = trueNotes
There is some related work in #347 for actually indexing HOCON values.
With this change you should probably still be able to programmatically exclude documents by interacting with the
Configon theDocumentdirectly as per https://typelevel.org/Laika/latest/07-reference/02-substitution-variables.html#programmatic-accessIt's not yet totally clear to me how much of #371 should be undone.