From 8fd9086d9892c276b0b6b5f203f879a1dbdae251 Mon Sep 17 00:00:00 2001 From: "Lucas F." Date: Tue, 20 Jan 2026 19:03:14 -0300 Subject: [PATCH] update: icons --- src/cache.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cache.zig b/src/cache.zig index 0a78820..2543d8a 100644 --- a/src/cache.zig +++ b/src/cache.zig @@ -2,11 +2,13 @@ const std = @import("std"); const Allocator = std.heap.ArenaAllocator; const parser = @import("parser.zig"); +const icons = @import("svg/icons.zig"); pub const TemplateCache = struct { arena: Allocator, cache: std.StringHashMapUnmanaged([]parser.Node), default_path: ?[]const u8 = "templates", + icons: ?icons.SvgIcon =null, pub fn init(child_allocator: std.mem.Allocator) TemplateCache { const arena = std.heap.ArenaAllocator.init(child_allocator); @@ -16,7 +18,6 @@ pub const TemplateCache = struct { }; } - pub fn deinit(self: *TemplateCache) void { self.arena.deinit(); } @@ -51,6 +52,10 @@ pub const TemplateCache = struct { } } + pub fn initIcons(self: *TemplateCache) !void { + self.icons = icons.SvgIcon.init(self.allocator()) catch null; + } + pub fn clear(self: *TemplateCache) void { self.deinit(); self.cache = .{};