╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Attachment.zig ───────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
94 _ = std.fmt.hexToBytes(&bytes, id) catch return null; 95 return bytes; 96 } 97 98 // the url an attachment's bytes are served from 99 pub fn url(page_arena: *std.heap.ArenaAllocator, identity: []const u8, id: []const u8) ![]const u8 { 100 return if (identity.len == 0) 101 try page_arena.allocator().print("/attachment:{s}", .{id}) 102 else 103 try page_arena.allocator().print("/{s}/attachment:{s}", .{ identity, id }); 104 } 105