Files
hello-htmx/templates/index.html
Jonas Kattendick 4489a8a8e5 refactor: render fragment explicitly
Instead of including the template for non-hx-requests, inject the
rendered fragment.
2023-05-10 20:37:27 +02:00

22 lines
518 B
HTML

{% extends "layout.html" %}
{% block content %}
<hgroup>
<h1>Hello htmx!</h1>
<p>A new old way to build web applications</p>
</hgroup>
<table>
{% match fragment %}
{% when Some with (fragment) %}
{{ fragment|safe }}
{% when None %}
<tr><td>
<button hx-get="/user" hx-target="table" hx-push-url="true">
Load data
</button>
</td></tr>
{% endmatch %}
</table>
{% endblock %}