retype icon indicating copy to clipboard operation
retype copied to clipboard

Ability to exclude a directory or category from search

Open nielsvz opened this issue 3 years ago • 1 comments

It would be very helpful if we could exclude a set of pages from search, either by excluding a specific path/directory or by category.

nielsvz avatar Jan 20 '22 13:01 nielsvz

Hi @nielsvz. Thanks for the suggestion. There are two configs that get close, although not exactly what you're looking for.

The visibility page config allows pages to be hidden and removed from the search results, although that will also remove the page from the navigation. The page is still built and you can navigate to the page in a browser if you know the path, but it is not added to the main navigation.

The exclude project config can be set to exclude pages, directories, or patterns from being included in the final output, although that means any matching pattern will not be available in the final website nor obviously the search results.

Being able to explicitly exclude some pages, directories, or patterns from the search results is a good idea and I think would be relatively easy for us to implement. I will investigate.

New exclude and include configs within the search project config would be a good place for this to live.

geoffreymcgill avatar Jan 20 '22 13:01 geoffreymcgill