Skip to content

Commit

Permalink
Changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
bglw committed Mar 1, 2023
1 parent 9f6171d commit ad5926f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,21 @@

## Unreleased

## v0.11.0 (February 16, 2023)
> Note: v0.12.0 will likely be the last feature release before an upcoming v1.0.0 that will contain a small handful of breaking changes. See the [v1.0.0 milestone](https://github.com/CloudCannon/pagefind/milestone/4) on GitHub for details and updates.
### Features & Improvements
* **CLI**: Added a "Keep Index URL" setting. (PR #233 — thanks @kenpetti-toasttab !). See [Pagefind CLI > Keep Index URL](https://pagefind.app/docs/config-options/#keep-index-url)
* **JS API**: Added a `totalFilters` object to the search response, containing the total matches for the search term under each filter
* **JS API**: Added an `unfilteredResultCount` key to the search response, containing the total matches for the search term if no filters were applied

### Fixes & Tweaks
* **CLI**: Stopped warning when encountering `data-pagefind-ignore="true"` instead of `data-pagefind-ignore`
* **Search**: Fixed merging filters from multiple indexes
* **Default UI**: Fixed filters sticking open once search input has been focused
* **Default UI**: Fixed the search input clearing when hitting the `Enter` key
* **Search / Default UI**: Fixed HTML tags in Pagefind excerpts not being escaped. The `content` key remains unprocessed

## v0.11.0 (February 16, 2023)

### Features & Improvements
* **CLI**: Improved `npx` wrapper compatibility on Windows, thanks @tylermercer!
Expand Down
8 changes: 6 additions & 2 deletions docs/content/docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,21 @@ Which will return an object with the following structure:
```json
{
"url": "/url-of-the-page/",
"excerpt": "A small snippet of the <mark>static</mark> content, with the search term(s) highlighted in mark elements.",
"excerpt": "A small snippet of the <mark>static</mark> content, with the search term(s) highlighted in &lt;mark&gt; elements.",
"filters": {
"author": "CloudCannon"
},
"meta": {
"title": "The title from the first h1 element on the page",
"image": "/weka.png"
},
"content": "The full content of the page, formatted as text. Cursus Ipsum Risus Ullamcorper...",
"content": "The full content of the page, formatted as text. <html> will not be escaped. ...",
"word_count": 242
}
```
> Note that `excerpt` will have HTML entities encoded before adding `<mark>` elements, so is safe to use as innerHTML. The `content` key is raw and unprocessed, so will need to be escaped by the user if necessary.
To load a "page" of results, you can run something like the following:
{{< diffcode >}}
Expand Down Expand Up @@ -125,6 +127,7 @@ If all filters have been loaded with `await pagefind.filters()`, counts will als
- The `filters` key contains the number of results if a given filter were to be applied in addition to the current filters.
- The `totalFilters` key contains the number of results if a given filter were to be applied instead of the current filters.
- The `unfilteredResultCount` key details the number of results for the search term alone, if no filters had been applied.
```js
{
Expand All @@ -134,6 +137,7 @@ If all filters have been loaded with `await pagefind.filters()`, counts will als
data: async function data(),
}
],
unfilteredResultCount: 100,
filters: {
"filter": {
"value_one": 4,
Expand Down

0 comments on commit ad5926f

Please sign in to comment.