diff options
| author | Fuwn <[email protected]> | 2026-04-17 17:13:51 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-04-17 17:13:51 +0000 |
| commit | 6089ff1b9fc921d6aa85287ee52abae951b1bfe0 (patch) | |
| tree | 8184df13e7707fe8469f47f2645a6ea42797d243 /src/mayu.gleam | |
| parent | chore(gleam.toml): Bump version (diff) | |
| download | mayu-6089ff1b9fc921d6aa85287ee52abae951b1bfe0.tar.xz mayu-6089ff1b9fc921d6aa85287ee52abae951b1bfe0.zip | |
perf: Reduce per-request work and I/O in render pipeline
Diffstat (limited to 'src/mayu.gleam')
| -rw-r--r-- | src/mayu.gleam | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mayu.gleam b/src/mayu.gleam index b204dc0..441887d 100644 --- a/src/mayu.gleam +++ b/src/mayu.gleam @@ -1,6 +1,8 @@ import cache import database +import envoy import gleam/erlang/process +import gleam/string import mist import request import simplifile @@ -12,8 +14,12 @@ pub fn main() { let _ = simplifile.create_directory("./data") let image_cache = cache.load_themes() + let version_tag = case envoy.get("MAYU_VERSION") { + Ok(version) -> "(v" <> version <> ")" + Error(_) -> "" + } let index_html = case simplifile.read("index.html") { - Ok(content) -> content + Ok(content) -> string.replace(content, "{{ MAYU_VERSION }}", version_tag) Error(_) -> { wisp.log_error("Failed to read index.html") |