From 478f73b93c37e5e32ce33eb1de963eeb23a5cc40 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 13 Mar 2025 12:18:53 +0800 Subject: Add basic template rendering --- templates/_head_common.htmpl | 3 +++ templates/index.htmpl | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 templates/_head_common.htmpl create mode 100644 templates/index.htmpl (limited to 'templates') diff --git a/templates/_head_common.htmpl b/templates/_head_common.htmpl new file mode 100644 index 0000000..6fcfea1 --- /dev/null +++ b/templates/_head_common.htmpl @@ -0,0 +1,3 @@ +{{ define _tp_head_common(handle: io::handle, title: str = "Untitled") (void | io::error | nomem) }} +{{ title }} +{{ end }} diff --git a/templates/index.htmpl b/templates/index.htmpl new file mode 100644 index 0000000..3562c86 --- /dev/null +++ b/templates/index.htmpl @@ -0,0 +1,14 @@ +{{ define tp_index(handle: io::handle) (void | io::error | nomem) }} +{! + let title: str = "Test"; +!} + + + +{{ render _tp_head_common(handle, title) }} + + +

{{ title }}

+ + +{{ end }} -- cgit v1.2.3