aboutsummaryrefslogtreecommitdiff
path: root/templates/_header.htmpl
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-13 20:17:19 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-13 20:17:19 +0800
commit3c3c383a9d6dec77e93272483699b3aef2c1dd47 (patch)
treedea1d4018a38b38fb4f8558b6279676dfda344e9 /templates/_header.htmpl
parentNote that patches are required on top of hare-http (diff)
downloadforge-3c3c383a9d6dec77e93272483699b3aef2c1dd47.tar.gz
forge-3c3c383a9d6dec77e93272483699b3aef2c1dd47.tar.zst
forge-3c3c383a9d6dec77e93272483699b3aef2c1dd47.zip
Partially port templates used by the index page
Diffstat (limited to 'templates/_header.htmpl')
-rw-r--r--templates/_header.htmpl14
1 files changed, 14 insertions, 0 deletions
diff --git a/templates/_header.htmpl b/templates/_header.htmpl
new file mode 100644
index 0000000..2eb8d19
--- /dev/null
+++ b/templates/_header.htmpl
@@ -0,0 +1,14 @@
+{{ define _tp_header(handle: io::handle, user_id_str: str, username: str) (void | io::error | nomem) }}
+<header id="main-header">
+ <div id="main-header-forge-title">
+ <a href="/">{{ global.title }}</a>
+ </div>
+ <div id="main-header-user">
+ {{ if user_id_str != "" }}
+ <a href="/:/users/{{ user_id_str }}">{{ username }}</a>
+ {{ else }}
+ <a href="/:/login/">Login</a>
+ {{ end }}
+ </div>
+</header>
+{{ end }}