feat: render document or fragment

This commit is contained in:
2023-05-09 22:36:59 +02:00
parent f10fc81658
commit 32f5afb10f
5 changed files with 66 additions and 53 deletions

19
templates/index.html Normal file
View File

@@ -0,0 +1,19 @@
{% extends "layout.html" %}
{% block content %}
<hgroup>
<h1>Hello htmx!</h1>
<p>A new old way to build web applications</p>
</hgroup>
<table>
{% if users.is_some() %}
{% include "fragment/user/table.html" %}
{% else %}
<tr><td>
<button hx-get="/user" hx-target="table" hx-push-url="true">
Load data
</button>
</td></tr>
{% endif %}
</table>
{% endblock %}