tailwindcss.com icon indicating copy to clipboard operation
tailwindcss.com copied to clipboard

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

Open oliverpool opened this issue 1 year ago • 2 comments

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

oliverpool avatar Sep 11 '24 13:09 oliverpool

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

vercel[bot] avatar Sep 11 '24 13:09 vercel[bot]

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

jnns avatar Sep 15 '24 07:09 jnns

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:

  • https://github.com/kemp/docs/blob/794285c4ac7d835066167ae5351803c1b14142ba/source/_layouts/master.blade.php#L19
  • https://github.com/kemp/docs/blob/794285c4ac7d835066167ae5351803c1b14142ba/source/opensearch.blade.xml

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!

gyohza avatar Dec 30 '24 15:12 gyohza

(currently the main blocker is the apparent lack of interest by the maintainers for this feature)

oliverpool avatar Jan 07 '25 12:01 oliverpool

@oliverpool Honestly this is pretty awesome. Unfortunately we moved to a new website with the v4 release last week so we aren't going to add features to the old website anymore. If you could do another PR against the new version (now on the main branch), that would be awesome though! Thanks for your contribution.

philipp-spiess avatar Jan 28 '25 12:01 philipp-spiess

@philipp-spiess this is the second PR adding this quicksearch-feature which gets dropped because of a website renewal. Each time without the maintainers showing any interest into merging it…

So sorry, but I am not motivated about opening a third PR, for which the chances to be ignored seem awesomely high.

oliverpool avatar Jan 29 '25 07:01 oliverpool

@oliverpool Really sorry for your experience, I totally understand your frustration.

To give some context: we're a very small team working on all Tailwind Labs products and have been knee-deep in trying to get the v4 release out for months now, so it was easy for us to postpone work on some open-source contributions until a later point. I know this is not a good excuse, but just wanted to give more context. Now that v4 is out we're making it a big priority to get on top of the open-source work again.

philipp-spiess avatar Jan 29 '25 10:01 philipp-spiess