wip: add client base and basic router

This commit is contained in:
2025-05-02 10:08:29 +02:00
parent 96bf9303ea
commit 4af8c825bb
8 changed files with 126 additions and 9 deletions

36
client/index.html Normal file
View File

@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Ask Stallman</title>
<link href="style.css" rel="stylesheet">
</head>
<body>
<header>
<h1>Ask Stallman</h1>
</header>
<div class="question">
<form method="post">
<input type="text" name="question" placeholder="Your question" autocomplete="off">
</form>
</div>
<div class="info">
<p>We kindly ask you to consider this before sending:</p>
<ul>
<li>
Please write your question in English. Dr Stallman will be reading it
unedited during the discussion block.
</li>
<li>Keep it kind. We are all here to learn something.</li>
<li>
Don't spam. We try to keep algorithmic moderation as permissive as possible.
So we ask you to moderate yourself.
</li>
</ul>
</div>
<footer>
<p><a href="https://zumepro.cz">Zumepro</a> 2025</p>
</footer>
</body>
</html>

View File

@@ -0,0 +1,31 @@
TARGETS_CLIENT_PAGES := index.html not_found.html
TARGETS_CLIENT_SCRIPTS := script.js
TARGETS_CLIENT_STYLES := style.css
TARGETS_CLIENT := $(TARGETS_CLIENT_PAGES:%=dst/%) \
$(TARGETS_CLIENT_SCRIPTS:%=dst/%) \
$(TARGETS_CLIENT_STYLES:%=dst/%)
.PHONY: client_clean
client_clean:
rm -rf client/node_modules
client/node_modules:
cd client && bun install
dst/%.html: client/%.html client/node_modules
@mkdir -p $(@D)
cat $< | bun run --cwd client html-minifier \
--collapse-inline-tag-whitespace \
--collapse-boolean-attributes \
--collapse-whitespace \
--remove-attribute-quotes \
--remove-comments \
--remove-redundant-attributes > $@
dst/%.css: client/%.scss client/node_modules
@mkdir -p $(@D)
bun run --cwd client sass $(notdir $<) --style compressed > $@
dst/%.js: client/%.ts client/node_modules
@mkdir -p $(@D)
bun build $< --minify --outfile $@

21
client/not_found.html Normal file
View File

@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Not Found | Ask Stallman</title>
<link href="style.css" rel="stylesheet">
</head>
<body>
<header>
<h1>Ask Stallman</h1>
</header>
<div class="info">
<h1>Not Found</h1>
<p>This page was not found. Please check the URL.</p>
</div>
<footer>
<p><a href="https://zumepro.cz">Zumepro</a> 2025</p>
</footer>
</body>
</html>

0
client/script.ts Normal file
View File

0
client/style.scss Normal file
View File