This commit is contained in:
2025-10-18 18:40:17 +02:00
parent b4923376bf
commit 9a25c81a41
34 changed files with 15917 additions and 49787 deletions
+5 -4
View File
@@ -1,4 +1,4 @@
include "pages/page.wl"
include "page.wl"
let posts = $query("SELECT P.id, P.title, P.is_link, P.content, (SELECT COUNT(*) FROM Comments as C WHERE c.parent_post=P.id) as num_comments, CURRENT_TIMESTAMP as date FROM Posts as P")
@@ -42,8 +42,9 @@ let style =
let main =
<main>
\if len(posts) == 0:
\if len(posts) == 0: {
<div id="no-posts">There are no posts yet!</div>
}
\for post in posts: {
@@ -55,10 +56,10 @@ let main =
<div class="item">
<div>
<a href=\'"'\link\'"'>\escape(post.title)</a>
<a href="\{link}">\{escape post.title}</a>
</div>
<div>
<span>\escape(post.date)</span> | <span>\escape(post.num_comments) comments</span>
<span>\{escape post.date}</span> | <span>\{escape post.num_comments} comments</span>
</div>
</div>
}