21 Commits
Author SHA1 Message Date
dualfroz 5c06f590ff Describe this repository 2026-10-22 21:02:21 +02:00
dualfroz 3a1d31147a Add an opt-in option to lowercase filter values
Filter values that only differ in case, like `Mint` and `mint`, came
through as separate values. The new `--lowercase-filters` option
(`lowercase_filters`, `PAGEFIND_LOWERCASE_FILTERS`, and
`lowercaseFilters` / `lowercase_filters` in the Node and Python
wrappers) lowercases filter values when indexing and merges values on
a page that become equal. Filter names are left as they are. Off by
default.

Fixes #737
2026-10-03 01:43:17 +02:00
upstream 1308f3c1bb Upstream Pagefind/pagefind state of the touched files before f1eedafd11 2026-10-03 01:43:17 +02:00
dualfroz b572112ae7 Allow merged indexes to be marked optional
A merged index that failed to load made mergeIndex throw, and the
failed instance stayed in the list, so search stopped working for
every index. Indexes passed with `optional: true` are now dropped
with a warning when they fail to load, and search runs over the
indexes that did load.

Fixes #887
2026-10-03 01:37:54 +02:00
upstream ebcea5d0cb Upstream Pagefind/pagefind state of the touched files before 5b9dce52fe 2026-10-03 01:37:49 +02:00
dualfroz 573bb96204 Resolve result images against an absolute baseUrl
Relative images were resolved against the page URL, but only the
pathname was kept, so with a baseUrl on another domain the image
still loaded from the search site. Keep the origin when the page URL
has one, in the Component UI's resolveUrl filter and in both Default
UI result templates. result_with_subs.svelte didn't resolve images at
all before.

Fixes #573
2026-10-03 01:33:54 +02:00
upstream ed42ec389b Upstream Pagefind/pagefind state of the touched files before a8baf2727f 2026-10-03 01:33:54 +02:00
dualfroz a114271432 Split compound words on soft hyphens 2026-10-02 16:24:37 +02:00
upstream adeab23665 Upstream Pagefind/pagefind state of the touched files before 2e9704cb17 2026-10-02 16:24:37 +02:00
dualfroz a3e68ffd4d Separate description list terms and details when indexing 2026-10-02 16:23:03 +02:00
upstream 4a2d8974bb Upstream Pagefind/pagefind state of the touched files before c0afa1bc49 2026-10-02 16:23:03 +02:00
dualfroz 085385c3e4 feat: apply Pagefind attributes by selector through config rules
exclude_selectors is the only way the config can reach into a page, and it
carries the semantics of data-pagefind-ignore="index". Every other control
Pagefind has lives on an attribute, so reaching it from the config meant a
new flag per attribute.

Add a rules list that pairs a selector with the attributes to set on the
elements it matches. The attributes are applied before every other handler,
so the rest of the parser reads them exactly as if the page had carried
them, and every documented attribute is reachable without new flags.

An attribute already present on the element wins, so a rule never overrides
markup. A selector that cannot be parsed is reported and skipped.

Rules are config-file only: a list of selectors with attribute maps does not
fit a CLI flag or an environment variable.
2026-09-23 10:26:08 +02:00
upstream c036b250ba Upstream Pagefind/pagefind state of the touched files before e920ec18c5 2026-09-23 10:26:08 +02:00
dualfroz a36c86c90c fix: exclude-selectors matches are excluded entirely, not just ignored
--exclude-selectors marked a match as "ignored", the same as a bare
data-pagefind-ignore, so metadata and filters inside the match were still
collected. Excluding img.emoji, for example, still let the emoji become the
page's auto-detected image.

The status was also applied after the element had been processed. For a void
element such as <img> that is too late twice over: its metadata has already
been read, and the parser has already popped back to the parent, so the
status landed on the parent instead and wiped out the rest of the page.

Match the selectors in a handler registered ahead of the main element
handler, which now reads that flag and gives the node Excluded status up
front. The built-in REMOVE_SELECTORS (head, nav, footer, ...) keep the old
Ignored status, so metadata tagged inside them still counts.

Fixes #692
2026-09-13 15:31:49 +02:00
upstream 5205bba40d Upstream Pagefind/pagefind state of the touched files before bd9ded0754 2026-09-11 23:13:08 +02:00
dualfroz 128a5c945a fix: percent-encode page URLs built from file paths
A file named Müsli.html was indexed with the URL /Müsli.html, which only
resolves if the host happens to serve the same byte sequence the index was
built from. Encode the URL that build_url derives from the file path using
the URL spec's path percent-encode set, leaving / and % alone so path
separators and already-encoded filenames are unaffected.

URLs supplied by the caller (data-pagefind-meta="url:...", addCustomRecord)
do not go through build_url and are untouched.

Fixes #619
2026-09-13 15:40:22 +02:00
upstream 3d8f53f964 Upstream Pagefind/pagefind state of the touched files before dfc8664a11 2026-09-11 23:07:10 +02:00
dualfroz 49fb9b1b9b fix: percent-encode page URLs built from file paths
build_url() escaped %, # and ? one by one, so a file name carrying any
other character that a URL path cannot hold - a space, a quote, an angle
bracket, a control character - was emitted raw and only resolved if the
host happened to serve the same byte sequence the index was built from.

Encode the URL that build_url derives from the file path with the URL
spec's path percent-encode set, leaving / alone so the separators between
path segments survive. % stays in the set, so a file literally named in
encoded form keeps pointing at the file that is on disk.

URLs supplied by the caller (data-pagefind-meta="url:...", addCustomRecord)
do not go through build_url and are untouched.

Fixes #619
2026-09-23 06:22:15 +02:00
upstream 996b9c3416 Upstream Pagefind/pagefind state of the touched files before 0259c44155 2026-09-11 23:07:10 +02:00
dualfroz 0428cf7195 fix(pagefind): skip exclude selectors that cannot be parsed
Every --exclude-selectors value was joined into a single selector string
handed to lol_html, so one selector the parser does not support took the
whole run down with an unwrap panic. Selectors are now validated one by
one and unsupported ones are reported through the logger and dropped.

Fixes #931
2026-09-10 08:42:44 +02:00
upstream c1c5f2ad73 Upstream Pagefind/pagefind state of the touched files before e139c4741e 2026-09-10 08:42:44 +02:00