bigskysoftware / htmx

</> htmx - high power tools for HTML
https://htmx.org
Other
38.11k stars 1.3k forks source link

Website search also shows v1 docs, which is not ideal #2813

Open corneliusroemer opened 2 months ago

corneliusroemer commented 2 months ago

When doing a search for e.g. websockets through website search, I get a lot of v1 results, which isn't ideal.

It would probably be best to exclude the v1 domain.

Brave Browser 2024-08-14 00 30 44

To clarify, this is the official htmx website search I'm talking about here - I didn't create the custom search.

Telroshan commented 2 months ago

Hey, htmx 1 is still active and maintained at the v1 branch. We published a separate website for it to keep its doc available online for people that cannot upgrade and need to keep using htmx 1 (for IE11 compatiblity for ex).

Maybe we could instead add a flashy message at the top of the pages to make it clear that's it's v1 not and not v2, but we'll keep this website online & visible in search engines

gotama commented 2 months ago

Hi @Telroshan

How can I understand more about htmx2 browser support?

Was alarmed at the ie11 support comment

Telroshan commented 2 months ago

We dropped IE11 support for htmx 2 @gotama , allowing us to not restrain from using ES6 syntax anymore (which IE11 didn't support), that modern browsers versions vastly support.

As htmx 1 was, and is still striving for IE11 compatibility, that's one of the reasons that led us to make a htmx 2 version in the first place ; introducing breaking changes. You can learn more on the latter in the htmx 2 upgrade guide which goes over the various breaking changes

corneliusroemer commented 2 months ago

Let me clarify, the issue is not that the V1 website exists. It's that the search for v2 includes V1 results.

The proposed solution is to make the search more specific for the V2 website to exclude V1 results.

Telroshan commented 2 months ago

I'm not sure what you mean by "make the search more specific" @corneliusroemer , as it's a Google search syntax that you're using here, what could we do on the htmx side?

v1 is on a subdomain at v1.htmx.org, so using Google search syntax still, you could exclude v1 results with say site:htmx.org -site:v1.htmx.org websocket, using the example of your screenshot.

corneliusroemer commented 2 months ago

It's not me using that Google search syntax, it's the official htmx website search I'm talking about. Just go to the website, click the search icon, then type some text and you get exactly what I see here.

corneliusroemer commented 2 months ago

This is what I mean for avoidance of ambiguity

Screenshot_20240814-161854.png

MichaelWest22 commented 2 months ago

An alternative google search we could use from the search box is:

+[inurl:https://htmx.org] websocket

But I'm not sure if its better to have the v1 results in there or not

corneliusroemer commented 2 months ago

It's confusing to have the v1 results if you're not on the v1 website. Why would one want to have it?

Telroshan commented 2 months ago

Ooooh ok, I even forgot we had a search at all, my bad @corneliusroemer you're right

I agree with @corneliusroemer, getting V1 results when searching on the main website isn't ideal. @MichaelWest22 , I'm thinking we would still want to include results from extensions.htmx.org when searching on the main website (as the extensions moved out to a separate subdomain for V2), wouldn't the syntax you suggest exclude all subdomains?

Relevant part of the website's code is here btw:

https://github.com/bigskysoftware/htmx/blob/bee498792cd36dd8deda43afbdddcb0d20eb208f/www/themes/htmx-theme/templates/base.html#L47-L48

I guess we just have to adjust the google search syntax here, I don't have any strong opinion about which syntax to use, so feel free to open a PR for this! If you feel like it, we'll probably also want the V1 website to only include V1 results!

MichaelWest22 commented 2 months ago

Yeah I tried many combinations but including extensions.htmx.org as well is just not easy. site:htmx.org -site:v1.htmx.org websocket also includes other odd sub domains confusing things like https://v2-0v2-0.htmx.org/

[inurl:https://htmx.org] websocket gave the best results but does not include the extensions.htmx.org site.

Also there is almost no useful information in extensions.htmx.org. one of the core issues is that all the websocket and sse documentation only exists in the v1 old site as all this documentation was removed with v2 and moved into the extensions git repo as .md files. But these are just not well indexed or easy to search in github. The extensions site was turned into a single vanilla html file only that just links to github with one sentence per extension. Trying to convert the extensions repo into a proper searchable documentation website via Zola like the core htmx repo uses is a lot of effort. Also there seems to be very little searchable content left about extensions on the htmx.org site now. Would be nice if there was some pages in the main htmx documentation site for common things like extensions, sse and websockets that are going to be highly searched terms that used to resolve well in v1 site.

corneliusroemer commented 2 months ago

@MichaelWest22 agree about extensions being badly surfaced for v2, I made a separate issue for that: #2819

Telroshan commented 2 months ago

I feel like subdomains such as https://v2-0v2-0.htmx.org/ shouldn't be indexed at all, likely an overlook from us (as those were temporary domains to test htmx 2 before it was released, that's not necessarily the kind of temp/volatile website we'd want to be indexed)

You're right about the extensions @MichaelWest22 , we went with the .md files approach for ease of maintenance, but it's true that the website isn't very searchable and can make stumbling upon extensions harder than it was in v1.

Ok so I'm discovering those fancy Google Search filters, I thought we would be able to do the following

(site:htmx.org -site:v1.htmx.org websocket) OR (site:github.com inurl:bigskysoftware/htmx-extensions/blob websocket)

So, search under any htmx domain/subdomain except v1 + search under the extensions repo as well. But for some reason, I don't get any result. Searching for any of these search groups works fine, but with the OR, seems it doesn't 🤔 if anyone masters google search filters here, help greatly appreciated 🫡

If we can get a search query that works + add simple banners on the V1 website to warn about v1/v2 and link to v2 extensions, we'd probably solve most (not all I know) of the inconvenience with the minimal effort. Otherwise, we'll probably have to make a Zola website like the main lib at some point indeed