Skip to content

Commit

Permalink
Add base template
Browse files Browse the repository at this point in the history
  • Loading branch information
raffomania committed Dec 27, 2023
1 parent 6a28438 commit 2b77a00
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Justfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set dotenv-load := true
set export := true

watch:
watch: start-database
systemfd --no-pid -s http::4040 -- cargo watch -- cargo run start --listenfd

run *args:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Install the dependencies:

- [Latest stable version of Rust](https://www.rust-lang.org/learn/get-started) (An older version might work as well, but is not tested)
- [just command runner](https://just.systems/man/en/chapter_1.html)
- [podman](http://podman.io/docs/installation)

Install dependencies available via cargo:

Expand Down
10 changes: 10 additions & 0 deletions templates/_base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/assets/railwind.css" />
<script src="/assets/htmx.1.9.9.js"></script>
</head>
<body class="mx-auto max-w-lg">
{% block content %}{% endblock %}
</body>
</html>
17 changes: 4 additions & 13 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/assets/railwind.css" />
<script src="/assets/htmx.1.9.9.js"></script>
</head>
<body class="mx-auto max-w-lg">
<div>Hello, htmx!</div>
<button hx-get="/htmx-fragment" hx-swap="outerHTML">
load some stuff!
</button>
</body>
</html>
{% extends "_base.html" %} {% block content %}
<div>Hello, htmx!</div>
<button hx-get="/htmx-fragment" hx-swap="outerHTML">load some stuff!</button>
{% endblock %}

0 comments on commit 2b77a00

Please sign in to comment.