aboutsummaryrefslogtreecommitdiff
path: root/src/z/File.zig
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2026-05-28 16:30:26 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2026-05-28 16:30:26 +0200
commitcd32a3ca0173676ed31486b5fa4dbd8c744cdec5 (patch)
treea9d0888c7a0e425ef8006cc9aade5889b78c074c /src/z/File.zig
parente749e2ccf97e6e7a2d1c124c4e5bed688e4c06f2 (diff)
implement frontend framework
Diffstat (limited to 'src/z/File.zig')
-rw-r--r--src/z/File.zig18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/z/File.zig b/src/z/File.zig
new file mode 100644
index 0000000..cd7094f
--- /dev/null
+++ b/src/z/File.zig
@@ -0,0 +1,18 @@
+const Minifier = @import("Minifier.zig");
+const Element = @import("html").Element;
+
+tag: ?@EnumLiteral(),
+minifier: Minifier,
+
+pub fn load(comptime self: @This(), comptime content: []const u8) Element {
+ if (self.tag) |tag| {
+ return .native(
+ tag,
+ .{},
+ .content(comptime self.minifier.minify(content)),
+ );
+ } else {
+ return .transparent(.content(comptime self.minifier.minify(content)));
+ }
+}
+