about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2026-08-13 21:39:09 +0100
committerArun Isaac2026-08-13 21:39:09 +0100
commit350ddbf6fc2acbc2b27aa7a4fbc8de491c95fa68 (patch)
tree17e3f7233160671cd6fc8ab6946918dbbdbb80c8
parent18d8cab694df428923656092c6f84aa813027e2d (diff)
downloaddomagi-350ddbf6fc2acbc2b27aa7a4fbc8de491c95fa68.tar.gz
domagi-350ddbf6fc2acbc2b27aa7a4fbc8de491c95fa68.tar.lz
domagi-350ddbf6fc2acbc2b27aa7a4fbc8de491c95fa68.zip
Add website.
-rw-r--r--.guix/domagi-website.scm62
-rw-r--r--website/style.css48
2 files changed, 110 insertions, 0 deletions
diff --git a/.guix/domagi-website.scm b/.guix/domagi-website.scm
new file mode 100644
index 0000000..6497ed2
--- /dev/null
+++ b/.guix/domagi-website.scm
@@ -0,0 +1,62 @@
+;;; domagi --- DuckDB-powered pangenome Swiss Army knife
+;;; Copyright © 2026 Arun Isaac <arunisaac@systemreboot.net>
+;;;
+;;; This file is part of domagi.
+;;;
+;;; domagi is free software: you can redistribute it and/or modify it under the
+;;; terms of the GNU General Public License as published by the Free Software
+;;; Foundation, either version 3 of the License, or (at your option) any later
+;;; version.
+;;;
+;;; domagi is distributed in the hope that it will be useful, but WITHOUT ANY
+;;; WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+;;; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+;;; details.
+;;;
+;;; You should have received a copy of the GNU General Public License along with
+;;; domagi. If not, see <https://www.gnu.org/licenses/>.
+
+(define-module (domagi-website)
+  #:use-module ((gnu packages fonts) #:select (font-charter font-fira-code))
+  #:use-module ((gnu packages haskell-xyz) #:select (pandoc))
+  #:use-module (guix gexp)
+  #:use-module (guix packages)
+  #:use-module ((domagi-package) #:select (domagi)))
+
+(define domagi-website-home-page-gexp
+  (with-imported-modules '((guix build utils))
+    #~(begin
+        (use-modules (guix build utils))
+
+        (copy-file #$(file-append (package-source domagi)
+                                  "/README.md")
+                   "README.md")
+        (invoke #$(file-append pandoc "/bin/pandoc")
+                "--standalone"
+                "--metadata" "title=domagi"
+                "--metadata" "document-css=false"
+                "--css=style.css"
+                "--from=gfm"
+                (string-append "--output=" #$output)
+                "README.md"))))
+
+(define-public domagi-website
+  (file-union "domagi-website"
+              `(("index.html"
+                 ,(computed-file "domagi-website-home-page.html"
+                                 domagi-website-home-page-gexp))
+                ("style.css" ,(local-file "../website/style.css"))
+                ("fonts/charter_regular.woff2"
+                 ,(file-append font-charter
+                               "/share/fonts/web/charter_regular.woff2"))
+                ("fonts/FiraCode-Regular.woff2"
+                 ,(file-append font-fira-code
+                               "/share/fonts/web/FiraCode-Regular.woff2"))
+                ("fonts/FiraCode-SemiBold.woff2"
+                 ,(file-append font-fira-code
+                               "/share/fonts/web/FiraCode-SemiBold.woff2")))))
+
+;; A quick wrapper to emulate how guix-forge serves the domagi website under a
+;; /domagi prefix
+(file-union "domagi-website"
+            `(("domagi" ,domagi-website)))
diff --git a/website/style.css b/website/style.css
new file mode 100644
index 0000000..f28c2f4
--- /dev/null
+++ b/website/style.css
@@ -0,0 +1,48 @@
+@font-face {
+    font-family: 'Charter';
+    src: url('/domagi/fonts/charter_regular.woff2') format('woff2');
+    font-weight: normal;
+    font-style: normal;
+}
+
+@font-face {
+    font-family: 'Fira Code';
+    src: url('/domagi/fonts/FiraCode-Regular.woff2') format('woff2');
+    font-weight: normal;
+    font-style: normal;
+}
+
+@font-face {
+    font-family: 'Fira Code';
+    src: url('/domagi/fonts/FiraCode-SemiBold.woff2') format('woff2');
+    font-weight: 600;
+    font-style: normal;
+}
+
+body {
+    margin: 40px auto;
+    max-width: 900px;
+    line-height: 1.6;
+    font-family: 'Charter';
+    font-size: 20px;
+    padding: 0 10px;
+}
+
+pre, code, samp {
+    font-family: 'Fira Code';
+}
+
+pre {
+    background-color: #f0f0f0;
+    padding: 1em;
+    font-size: 0.9em;
+}
+
+code, samp {
+    font-size: 0.8em;
+    font-weight: 600;
+}
+
+img {
+    max-width: 100%;
+}