From: Ardis Lu Date: Thu, 23 Jul 2026 06:30:07 +0000 (-0700) Subject: Enable GitHub-style admonitions ("alerts") X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=2f776ef927b796d8ce2fcfb8f80a9bc796895bf5;p=git.ardis.lu Enable GitHub-style admonitions ("alerts") --- diff --git a/srv/git/git-shell-commands/init b/srv/git/git-shell-commands/init index e63cf4e..cd4ccfe 100644 --- a/srv/git/git-shell-commands/init +++ b/srv/git/git-shell-commands/init @@ -53,7 +53,7 @@ git init --bare --quiet cat > "$path/hooks/post-update" << EOL #!/bin/sh git update-server-info -git cat-file blob HEAD:README.md | comrak --gfm --syntax-highlighting base16-ocean.light > "$(git rev-parse --git-common-dir)/README.html" +git cat-file blob HEAD:README.md | comrak --gfm --syntax-highlighting base16-ocean.light --extension alerts > "$(git rev-parse --git-common-dir)/README.html" git maintenance run EOL chmod a+x "$path/hooks/post-update" diff --git a/usr/share/gitweb/static/custom.css b/usr/share/gitweb/static/custom.css index 5bbe921..8475b93 100644 --- a/usr/share/gitweb/static/custom.css +++ b/usr/share/gitweb/static/custom.css @@ -160,4 +160,40 @@ div.diff { div.diff:is(.header, .extended_header, .from_file, .to_file, .chunk_header) { inset-inline-start: 0; position: sticky; +} + +.markdown-alert-note { + --alert-color: #0969da; +} + +.markdown-alert-tip { + --alert-color: #1a7f37; +} + +.markdown-alert-important { + --alert-color: #8250df; +} + +.markdown-alert-warning { + --alert-color: #9a6700; +} + +.markdown-alert-caution { + --alert-color: #cf222e; +} + +.markdown-alert { + padding: 8px 16px; + margin-block-end: 16px; + border-inline-start: 4px solid var(--alert-color); + + & p { + margin: 0; + } + + & .markdown-alert-title { + color: var(--alert-color); + font-weight: 700; + margin-block-end: 16px; + } } \ No newline at end of file