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

Add OpenSearch support #5198

Merged

Conversation

maximilian-walter
Copy link
Contributor

Add XML-file and HTML meta-tag so browsers can autodiscover the search of BookStack instances. See:

https://developer.mozilla.org/en-US/docs/Web/OpenSearch

Closes #5122

@ssddanbrown
Copy link
Member

Thanks for offering this @maximilian-walter!

Here's my feedback from a quick review (have not actually pulled down and tested yet):

Are you happy to take on these changes? Just let me know if you need further help/guidance, or if you're not able to perform further work for any reason.

@maximilian-walter
Copy link
Contributor Author

Thanks @ssddanbrown for your feedback!

Can the images be reduced down to just the 32 & 64? Can't see evidence of large images being used here, and I'd prefer to keep things to what's required/used where possible.

I don't know if higher resolutions would be used. I would expect that, but I did not validate it. Because we have them already I would keep them, but I am also fine if you wish to reduce the number of links.

The URL has a method attribute, but I can't see this as part of the spec?

You are right, I removed the attribute. We don't need it anyway.

The ShortName must be limited to 16 characters or less.

The hardlimit of 16 characters is now enforced.

The Description is lacking translation support.

I moved the description to the language file. I hope this was the correct way of doing it in regards of Crowdin.

We'd want to have some tests to cover this, (Simple example of tests for licenses endpoint).

I added some basic test based on your HtmlTest-class. Because the Symfony Crawler is used, I assumed it is fine to feed XML to it. :)

A proper XML schema validation would be much better, but I did not find any DTD file for this standard.

@ssddanbrown ssddanbrown added this to the Next Feature Release milestone Sep 27, 2024
@ssddanbrown
Copy link
Member

Thanks @maximilian-walter! Could you just also restore the two .gitignore files removed in this PR?
BTW, I'll probably squash merge this to contain the feature to one commit, and prevent files being removed/re-added in git history if that's okay.

@maximilian-walter
Copy link
Contributor Author

@ssddanbrown Sorry, I added the missing files again and rebased my branch so the files do not get removed and added again. Squashing is still a good idea. I used multiple small commits only for a easier code review. :)

@ssddanbrown ssddanbrown merged commit 2f74cfb into BookStackApp:development Sep 30, 2024
1 check passed
@ssddanbrown
Copy link
Member

Now merged for next feature release, thanks again @maximilian-walter!

While testing I found that chrome would totally ignore opensearch discovery if not hosting on the root of the domain, whereas Firefox was totally happy with that. Will have to remember this for future potential support scenarios!

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

Successfully merging this pull request may close these issues.

Add OpenSearch support
2 participants