From aff9a092bdb3063782a5be90d4ea398b857a86b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20=28xq=29=20Quei=C3=9Fner?= Date: Mon, 15 Mar 2021 19:49:05 +0100 Subject: [PATCH] Adds anchor rendering. --- .gitmodules | 2 +- deps/koino | 2 +- src/main.zig | 15 ++++++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 3fc6085..9aade95 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "deps/koino"] path = deps/koino - url = https://github.com/kivikakk/koino + url = https://github.com/MasterQ32/koino diff --git a/deps/koino b/deps/koino index bd71384..0be309f 160000 --- a/deps/koino +++ b/deps/koino @@ -1 +1 @@ -Subproject commit bd71384edb665ee6cfecb573296c23ac6d15a033 +Subproject commit 0be309f6c47582ecb8d8ca577c998b72226a1ecd diff --git a/src/main.zig b/src/main.zig index 96dc05d..80b40b3 100644 --- a/src/main.zig +++ b/src/main.zig @@ -9,12 +9,12 @@ const markdown_options = koino.Options{ }, .render = .{ .header_anchors = true, + .anchor_icon = "ยง ", }, }; /// verifies and parses a file name in the format /// "YYYY-MM-DD - " [.*] ".md" -/// fn isValidArticleFileName(path: []const u8) ?Date { if (path.len < 16) return null; @@ -596,6 +596,19 @@ const Website = struct { \\ padding-left: 0.5em; \\ margin-left: 0.5em; \\ } + \\ + // Make links in headings invisible + \\ h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { + \\ text-decoration: none; + \\ font-weight: lighter; + \\ color: unset; + \\ opacity: 50%; + \\ visibility: hidden; + \\ margin-left: -1em; + \\ } + \\ h1:hover a, h2:hover a, h3:hover a, h4:hover a, h5:hover a, h6:hover a { + \\ visibility: visible; + \\ } \\ \\ \\