Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding flag to retain “index.html” in results URLs #233

Merged
merged 3 commits into from
Feb 27, 2023

Conversation

kenpetti-toasttab
Copy link
Contributor

What

  • Add a new CLI flag to retain “index.html” in search result links
  • Added a test case for this flag
  • Added documentation with usage

Why

My static site does not use “pretty” links. The current Pagefund behavior generates search result links that do not accurately link to my content. This change makes the links compatible.

Testing

I tested this manually locally. I also added a simple test for this flag. Any ideas for additional test cases are welcome.

@kenpetti-toasttab kenpetti-toasttab changed the title Adding keep index url Adding flag to retain “index.html” Feb 24, 2023
@kenpetti-toasttab kenpetti-toasttab changed the title Adding flag to retain “index.html” Adding flag to retain “index.html” in results URLs Feb 24, 2023
Copy link
Contributor

@bglw bglw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, nice addition 🙂

Comment on lines +66 to +75
### Keep Index URL

```json
{
"keepIndexUrl": true
}
```

Keeps `index.html` at the end of search result paths. For example, a file called "public/cat/index.html will have a search result url of `public/cat/index.html`. Defaults to `false`, stripping `index.html`.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These docs should actually live in docs/config-options.md — this page is for the browser-side config — but I can move them to the correct place after this is merged 🙂

@bglw bglw enabled auto-merge February 27, 2023 19:24
@bglw bglw merged commit 9737d83 into CloudCannon:main Feb 27, 2023
@kenpetti-toasttab
Copy link
Contributor Author

No problem! When should I expect this to be in a release?

@bglw
Copy link
Contributor

bglw commented Feb 28, 2023

A little while away from a stable release sorry @kenpetti-toasttab — I'm working on a raft of features that might push out to a full v1.0.0 release.

I am pushing out some prereleases while testing, though, so if you're running through npx you can use:

npx pagefind@0.12.0-beta.0

And that release contains this PR 🙂 (if you're using the binaries directly, you can find them here)

These prereleases will eventually contain some breaking changes, but 0.12.0-beta.0 doesn't yet, so if you use that one directly you should be fine 🙂

@kenpetti-toasttab
Copy link
Contributor Author

Great, thanks! Really happy so far, looking forward to seeing where this project goes!

@bglw
Copy link
Contributor

bglw commented Mar 1, 2023

Change of plans! v0.12.0 is now out containing this feature 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants