1

Some days ago I found htmx which I really like.

It is simple and gives me a way to use my favorite backend solution, and I can avoid a lot of JavaScript.

But I am unsure if the google bot will find the lazy loaded snippets.

Example:

<div hx-post="/clicked"
     hx-trigger="click"
     hx-target="#parent-div"
     hx-swap="outerHTML">
    Click Me!
</div>

This tells htmx:

"When a user clicks on this div, issue an HTTP POST request to '/clicked' and use the content from the response to replace the element with the id parent-div in the DOM"

Will the google bot find data which I load lazy by htmx?

0
2

The google crawlers do execute javascript these days, so content lazily loaded by htmx might be visible, but no guarantees.

If you use the hx-boost attribute to enhance normal links and forms, that should be very index-bot friendly:

https://htmx.org/attributes/hx-boost/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.