]> git.ardis.lu - git.ardis.lu/commitdiff
Enable GitHub-style admonitions ("alerts")
authorArdis Lu <ardisglu@gmail.com>
Thu, 23 Jul 2026 06:30:07 +0000 (23:30 -0700)
committerArdis Lu <ardisglu@gmail.com>
Thu, 23 Jul 2026 06:30:07 +0000 (23:30 -0700)
srv/git/git-shell-commands/init
usr/share/gitweb/static/custom.css

index e63cf4eb6f1d1bc156168c23433213c56ee6d512..cd4ccfe8288e4c0d947701e71c868f2739371caf 100644 (file)
@@ -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"
index 5bbe92173a243eaa8065d1c475d78ddec284522f..8475b9368abe58a4e9f98afe821809dbbd8c2968 100644 (file)
@@ -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
This page took 0.035404 seconds and 4 git commands to generate.