aboutsummaryrefslogtreecommitdiff
path: root/cgit
diff options
context:
space:
mode:
Diffstat (limited to 'cgit')
-rw-r--r--cgit/cgitrc5
-rwxr-xr-xcgit/filters/about.sh35
-rwxr-xr-xcgit/filters/html-transform.py2
-rw-r--r--cgit/static/README.md9
-rw-r--r--cgit/static/cgit.css24
5 files changed, 65 insertions, 10 deletions
diff --git a/cgit/cgitrc b/cgit/cgitrc
index d4297f5..bed7047 100644
--- a/cgit/cgitrc
+++ b/cgit/cgitrc
@@ -1,5 +1,5 @@
root-title=Akshay's git repos
-root-desc=this is where my cooler projects live
+root-desc=this is where my projects live
root-readme=/usr/share/webapps/cgit/ediblemonad/README.md
# Theme
@@ -9,9 +9,6 @@ favicon=/favicon.ico
head-include=/usr/share/webapps/cgit/ediblemonad/header.html
footer=/usr/share/webapps/cgit/ediblemonad/footer.html
-# TODO: submodule links
-# module-link=/cgit/submodule/%s/commit?id=%s
-
source-filter=/usr/lib/cgit/filters/syntax-highlighting.py
about-filter=/usr/lib/cgit/filters/ediblemonad/about.sh
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
diff --git a/cgit/static/README.md b/cgit/static/README.md
index 895f456..ab53933 100644
--- a/cgit/static/README.md
+++ b/cgit/static/README.md
@@ -1,5 +1,10 @@
# Hey!
-I keep my projects here.
+You can find my projects here.
-Also have these mirrored on github with some more things: <a href="https://github.com/phenax" target="_blank _parent" rel="noopener">https://github.com/phenax</a>
+I have these mirrored on <a href="https://github.com/phenax" target="_blank _parent" rel="noopener">my github</a>. I also write about things I find interesting [here](https://ediblemonad.dev).
+
+
+### Contributing
+
+If you'd like to contribute to any of the repositories hosted here, you can email a patch to <akshay.n0@protonmail.com> with the subject line `PATCH <repo name>: <patch description>`.
diff --git a/cgit/static/cgit.css b/cgit/static/cgit.css
index 2fa54e2..6a3040a 100644
--- a/cgit/static/cgit.css
+++ b/cgit/static/cgit.css
@@ -2,9 +2,9 @@ html, body {
background-color: black;
line-height: 1.6;
font-size: 18px;
- --color-accent: #00a0a0;
- --color-accent-1: #009090;
- --color-accent-2: #007070;
+ --color-accent: #61f9b0;
+ --color-accent-1: #51e9a0;
+ --color-accent-2: #31c980;
}
input[type=search], input[type=text], select {
@@ -1108,3 +1108,21 @@ div#cgit table.ssdiff td.space div {
background-color: transparent;
}
+.discussions {
+ text-align: right;
+}
+.discussions-modal {
+ text-align: left;
+ background-color: black;
+ border: 2px solid #222;
+ box-shadow: 0 0 20px 10px rgb(255, 255, 255, 0.1);
+ max-width: 800px;
+ width: 100%;
+}
+.discussions-modal::backdrop {
+ background-color: rgb(0,0,0,0.6);
+}
+.discussions-close {
+ float: right;
+}
+