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

Custom Hostname Redirection for Empty Queries #35

Open
limaceous-bushwhacker opened this issue Feb 2, 2025 · 2 comments
Open

Custom Hostname Redirection for Empty Queries #35

limaceous-bushwhacker opened this issue Feb 2, 2025 · 2 comments

Comments

@limaceous-bushwhacker
Copy link

Description:
I have some custom site searches that use the site: operator in Google (e.g., searching Reddit with site:reddit.com). However, when I perform a search without entering a query, I end up on a Google search results page with site:reddit.com as the only input. Instead, I would like to be redirected directly to reddit.com.

Expected Behavior:
If a custom site search (e.g., site:reddit.com) is used without a query, yang should redirect to reddit.com instead of a Google search page.

Potential Solution:
Introduce a configuration option to specify custom hostname redirections when no query is provided.

This would allow users to define fallback URLs when performing site-specific searches with no query.

Would love to hear your thoughts on whether this is possible or if there's already a way to achieve this. Thanks for your work on yang!

@dmlls
Copy link
Owner

dmlls commented Feb 7, 2025

Hi @limaceous-bushwhacker, and thank you for the detailed feature request!

I can see this being useful. Right now there is the option to "Open Base URL" when no query is inputted, but it's true that this can be a bit limiting in some cases (e.g., your case, or also in case you don't want to open the base URL but rather some specific path within that URL).

I'll try to find a way of implementing this without cluttering too much the settings. Together with #33 (which will also require changes in the storage schema), it can make a good new feature for a 1.0.0 release.

@limaceous-bushwhacker
Copy link
Author

Thanks for considering this. The "Open Base URL" option is useful, but having more control over redirections would be a great improvement.

Let me know if I can help test anything when the time comes.

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

No branches or pull requests

2 participants