Skip to content

Commit 33ef751

Browse files
author
Marcus Hammarberg
committed
New post
1 parent 1e1561c commit 33ef751

File tree

2 files changed

+521
-4
lines changed

2 files changed

+521
-4
lines changed

_posts/2025-01-15-htmx-todo-tutorial-II.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,15 @@ I've made similar `if`-statement around the (still hardcoded) Todo-list.
298298
299299
```html
300300
<% if (!user) { %>
301-
<h2>Log in to see your To-do list</h2>
301+
<div class="todo-container">
302+
<h2>Log in to see your To-do list</h2>
303+
</div>
302304
<% } else { %>
303-
<h2>Todo items</h2>
304-
<!-- The entire hard-coded todo list -->
305-
<% } %
305+
<div class="todo-container">
306+
<h2>Todo items</h2>
307+
<!-- And so on -->
308+
</div>
309+
<% } %>
306310
```
307311
308312
The readability is enhanced by using `includes` and I've done that in the finished code, but I'm leaving that out for brevity.

0 commit comments

Comments
 (0)