From 54b2525029fc84f9c562bc9132b72dcedc6eef20 Mon Sep 17 00:00:00 2001 From: yuzu Date: Thu, 8 May 2025 22:40:57 -0500 Subject: [PATCH] new styles v2 --- src/app/views/blogs.zig | 32 ++++++++++++++++---------------- src/app/views/blogs/get.zmpl | 11 ++++++++++- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/src/app/views/blogs.zig b/src/app/views/blogs.zig index 57a32ad..4d260a4 100644 --- a/src/app/views/blogs.zig +++ b/src/app/views/blogs.zig @@ -16,7 +16,7 @@ pub const Fragments = struct { } pub fn block(allocator: std.mem.Allocator, node: Node) ![]const u8 { - const style = "font-family: Monospace;"; + const style = "font-family: Monospace; background: #1e1e1e; color: #d4d4d4; padding: 12px; border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);"; return if (node.meta) |meta| std.fmt.allocPrint(allocator, @@ -30,29 +30,29 @@ pub const Fragments = struct { pub fn link(allocator: std.mem.Allocator, node: Node) ![]const u8 { return std.fmt.allocPrint(allocator, - \\{s} + \\{s} , .{ node.href.?, node.title.? }); } pub fn image(allocator: std.mem.Allocator, node: Node) ![]const u8 { return std.fmt.allocPrint(allocator, - \\ + \\ , .{ node.href.?, node.title.? }); } - pub const h1 = .{ "

", "

\n" }; - pub const h2 = .{ "

", "

\n" }; - pub const h3 = .{ "

", "

\n" }; - pub const h4 = .{ "

", "

\n" }; - pub const h5 = .{ "
", "
\n" }; - pub const h6 = .{ "
", "
\n" }; - pub const bold = .{ "", "" }; - pub const italic = .{ "", "" }; - pub const unordered_list = .{ "" }; - pub const ordered_list = .{ "
    ", "
" }; - pub const list_item = .{ "
  • ", "
  • " }; - pub const code = .{ "", "" }; - pub const paragraph = .{ "\n

    ", "

    \n" }; + pub const h1 = .{ "

    ", "

    \n" }; + pub const h2 = .{ "

    ", "

    \n" }; + pub const h3 = .{ "

    ", "

    \n" }; + pub const h4 = .{ "

    ", "

    \n" }; + pub const h5 = .{ "
    ", "
    \n" }; + pub const h6 = .{ "
    ", "
    \n" }; + pub const bold = .{ "", "" }; + pub const italic = .{ "", "" }; + pub const unordered_list = .{ "" }; + pub const ordered_list = .{ "
      ", "
    " }; + pub const list_item = .{ "
  • ", "
  • " }; + pub const code = .{ "", "" }; + pub const paragraph = .{ "\n

    ", "

    \n" }; pub const default = .{ "", "" }; }; diff --git a/src/app/views/blogs/get.zmpl b/src/app/views/blogs/get.zmpl index 0902091..2f6a517 100644 --- a/src/app/views/blogs/get.zmpl +++ b/src/app/views/blogs/get.zmpl @@ -1,6 +1,15 @@
    -

    {{.blog.title}}

    +

    {{.blog.title}}

    {{zmpl.fmt.raw(zmpl.ref("blog.content"))}}
    + + + + +