`hx-push-url="true"` ties an HTMX search field to the browser URL. As the search changes, its value becomes a query parameter, so the current results can be deep-linked, copied, or bookmarked. section 12.4
A bookmarked search still needs a useful initial page render. Render the initial results normally, then let HTMX replace the results area with partial HTML for later searches; the browser history is not a substitute for server-side rendering. section 12.4
Search musicians without losing the URL
Place `hx-push-url="true"` beside `hx-get`, a delayed `keyup` trigger, and `hx-target="#results"`. The view reads `search_text`, renders the full search page for a normal request, and returns only the results partial for an HTMX request. section 12.4
Listing 12.7 The template for the search page
<!-- RiffMates/templates/search_musicians.html -->
{% extends "base.html" %}
{% block content %}
<h1>Search Musicians</h1>
<input name="search_text" #1
placeholder="Search for musicians..."
type="text"
value="{{search_text}}" #2
hx-get="{% url 'search_musicians' %}" #3
hx-trigger="keyup changed delay:500ms" #4
hx-target="#results" #5
hx-push-url="true"> #6
<div class="results" id="results"> #7
{% include "partials/musician_results.html" %} #8
</div>
{% endblock content %}
The search input shows `hx-push-url="true"` working alongside the request URL, trigger, and results target. section 12.4
