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

Allow quick search via ?q=... search param #1871

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oliverpool
Copy link
Contributor

@oliverpool oliverpool commented Sep 11, 2024

Reviving of #107 (requested in #789)

This is a minimal change, so that when the URL contains ?q=search-term:

  • the search-box is automatically opened
  • the given search-term is automatically searched for

Preview: https://tailwindcss-com-git-fork-oliverpool-master-tailwindlabs.vercel.app/?q=collapse

Copy link

vercel bot commented Sep 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tailwindcss-com ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 11, 2024 1:31pm

@jnns
Copy link

jnns commented Sep 15, 2024

This is great. With this feature merged, things like a DuckDuckGo Bang for tailwindcss.com would be possible.

@gyohza
Copy link

gyohza commented Dec 30, 2024

Hi! #789 also advocates implementing the OpenSearch specs.

Adding the search query is great, but does little benefit if it's a hidden or guess-based feature. Implementing the OpenSearch specs would mean browsers (at least Firefox and Chromium-based browsers) would promptly detect the underlying custom search engine for the website, including its URL, name and icon, among other benefits.

You could reuse the implementation from #107:

One last suggestion: it would be nice to update the query param once another search has been performed. We'd want the URL to always reflect the current content, and updating the URL explicitly indicates that the custom search feature is available (e.g. I myself perform random searches to see if the URL changes, then just swap the search query with %s and add it to my custom search engines).

What do you think?

It's very annoying having to navigate to the TW docs all the time and manually activating the search modal. Looking forward to this neat little 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.

3 participants