size: 466 B

1const std = @import("std");
2const fs = std.fs;
3const json = std.json;
4const mem = std.mem;
5
6pub const file_path = "_loa_meta.json";
7
8const Meta = @This();
9
10site_name: []const u8,
11tagline: []const u8,
12domain: []const u8,
13
14pub fn load(arena: mem.Allocator, dir: fs.Dir) !Meta {
15 const meta_text = try dir.readFileAlloc(arena, file_path, 1024 * 16);
16
17 return try json.parseFromSliceLeaky(Meta, arena, meta_text, .{
18 .allocate = .alloc_if_needed,
19 });
20}