You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b4efcbf
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+6-14Lines changed: 6 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,23 +109,17 @@ Using the Default UI is still supported, but it is no longer Pagefind's primary
109
109
You can add the Pagefind UI to any page with the following snippet. The `/pagefind/` directory, or the directory specified by `output_subdir` in the [config](#1-output_subdir), will be created along with its files.
new PagefindUI({ element: "#search", showSubResults: true });
123
119
});
124
120
</script>
125
121
```
126
122
127
-
`{% pagefind_asset_url 'filename' %}`and `{% pagefind_bundle_path %}` both handle all four combinations of `baseurl` and `output_subdir` being set or unset, so the snippet works correctly for root deployments, GitHub Pages project sites, and custom `output_subdir` values without any extra configuration.
128
-
129
123
For dark mode:
130
124
131
125
```css
@@ -142,15 +136,13 @@ For more details, see [Using the Default UI](https://pagefind.app/docs/ui-usage/
142
136
143
137
#### 2. Pagefind Component UI
144
138
145
-
Add the following snippet to `<head>`. The bundle directoryspecified by `output_subdir` in the [config](#1-output_subdir) (default: `pagefind`) will be created along with its files.
139
+
Add the following snippet to `<head>`. The `/pagefind/` directory, or the directory specified by `output_subdir` in the [config](#1-output_subdir), will be created along with its files.
If you initialize the component via JavaScript, pass `bundlePath: "{% pagefind_bundle_path %}"` so the search bundle resolves correctly when `baseurl` is set.
0 commit comments