aboutsummaryrefslogtreecommitdiff
path: root/cgit/filters
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2026-07-07 13:04:42 +0530
committerAkshay Nair <phenax5@gmail.com>2026-07-07 13:04:42 +0530
commit4c142d2a977a2c377ea3bef30fa986010056ba3e (patch)
treee1244ef962f2c60dc4cf5b62d3a7e8005e0e1463 /cgit/filters
parent17d0f321faeecf5ea46faccb4157347673690def (diff)
downloadbacchus-remote-4c142d2a977a2c377ea3bef30fa986010056ba3e.tar.gz
bacchus-remote-4c142d2a977a2c377ea3bef30fa986010056ba3e.zip
Add comment modal + color changes
Diffstat (limited to 'cgit/filters')
-rwxr-xr-xcgit/filters/about.sh35
-rwxr-xr-xcgit/filters/html-transform.py2
2 files changed, 36 insertions, 1 deletions
diff --git a/cgit/filters/about.sh b/cgit/filters/about.sh
index 9455ce7..f1c660b 100755
--- a/cgit/filters/about.sh
+++ b/cgit/filters/about.sh
@@ -3,8 +3,8 @@
set -eu
-# TODO: Add toc links for headers in markdown
md_to_html() {
+ render_discussions_modal
echo '<div class="markdown">'
md2html \
--fpermissive-url-autolinks --fpermissive-www-autolinks \
@@ -21,5 +21,38 @@ to_html() {
esac
}
+render_discussions_modal() {
+ cat <<'HTML'
+ <div class="discussions">
+ <button type="button" class="discussions-trigger" command="show-modal" commandfor="discussions">
+ Leave a comment
+ </button>
+
+ <dialog id="discussions" class="discussions-modal">
+ <button type="button" class="discussions-close" command="close" commandfor="discussions">
+ Close
+ </button>
+ <div id="discussions-comment">
+ <script src="https://giscus.app/client.js"
+ data-repo="phenax/ediblemonad.dev"
+ data-repo-id="MDEwOlJlcG9zaXRvcnk3NTY4OTA5MQ=="
+ data-category="Repo discussions"
+ data-category-id="DIC_kwDOBILsg84DAnGD"
+ data-mapping="url"
+ data-strict="0"
+ data-reactions-enabled="1"
+ data-emit-metadata="0"
+ data-input-position="bottom"
+ data-theme="dark"
+ data-lang="en"
+ crossorigin="anonymous"
+ async>
+ </script>
+ </div>
+ </dialog>
+ </div>
+HTML
+}
+
(to_html "$@" | /usr/lib/cgit/filters/ediblemonad/html-transform.py) || \
(echo "<pre>Error rendering markdown</pre>" && cat)
diff --git a/cgit/filters/html-transform.py b/cgit/filters/html-transform.py
index 51b3538..4579ee0 100755
--- a/cgit/filters/html-transform.py
+++ b/cgit/filters/html-transform.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python3
# Rewrite image urls in about section
+# TODO: Add toc links for headers in markdown
+
import sys
from html.parser import HTMLParser
import html