pagefind icon indicating copy to clipboard operation
pagefind copied to clipboard

Ability to have "include selectors" in addition to "exclude selectors"

Open tfrancart opened this issue 6 months ago • 1 comments

Hello

I am in a situation of generating static website from raw data. Lot of pages, and quite well structured webpages with metadata name and values, like:

title: blah
date of creation : X
author: foo
content : here a long text

I don't want all the metadata names to be be indexed ("title", "date of creation", "author", "content" in the above example), only the values. It would be very practical for me to be able to provide inclusion selectors rather than exclusion selectors because there are only a few places in the webpages that I want to be indexed, and a lot more that I don't want to be indexed

tfrancart avatar Aug 20 '25 07:08 tfrancart

This makes sense!

I think the data-pagefind-body tag will actually work for this use-case, not that the naming of it would imply that. Pages without data-pagefind-body will be ignored, and the tag can exist multiple times on each page. So if you tag the title, date, author, and content each as data-pagefind-body you should get where you want :)

bglw avatar Aug 27 '25 02:08 bglw