about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2025-11-03 16:04:28 +0000
committerArun Isaac2025-11-03 17:54:51 +0000
commit5bc683811249adaaccad7ad825ab22273bc61f6c (patch)
tree3b8aa94d881902973e8cb6db640734e50e4443b7
parent6d2f5f84c29bf8470dff77f86f3018acea4e9e98 (diff)
downloadguix-forge-5bc683811249adaaccad7ad825ab22273bc61f6c.tar.gz
guix-forge-5bc683811249adaaccad7ad825ab22273bc61f6c.tar.lz
guix-forge-5bc683811249adaaccad7ad825ab22273bc61f6c.zip
Add G-expression to build website.
-rw-r--r--guix/guix-forge-website.scm78
1 files changed, 78 insertions, 0 deletions
diff --git a/guix/guix-forge-website.scm b/guix/guix-forge-website.scm
new file mode 100644
index 0000000..2b0be61
--- /dev/null
+++ b/guix/guix-forge-website.scm
@@ -0,0 +1,78 @@
+;;; guix-forge --- Guix software forge meta-service
+;;; Copyright © 2025 Arun Isaac <arunisaac@systemreboot.net>
+;;;
+;;; This file is part of guix-forge.
+;;;
+;;; guix-forge 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.
+;;;
+;;; guix-forge 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 guix-forge.  If not, see
+;;; <https://www.gnu.org/licenses/>.
+
+(define-module (guix-forge-website)
+  #:use-module ((gnu packages fonts) #:select (font-charter font-fira-code))
+  #:use-module ((gnu packages skribilo) #:select (skribilo))
+  #:use-module (guix gexp)
+  #:use-module (guix git-download)
+  #:use-module (guix utils))
+
+(define-public guix-forge-source
+  (local-file ".."
+              "guix-forge-checkout"
+              #:recursive? #t
+              #:select? (or (git-predicate (dirname (current-source-directory)))
+                            (const #t))))
+
+(define guix-forge-website-home-page-gexp
+  (with-imported-modules '((guix build utils))
+    #~(begin
+        (use-modules (guix build utils))
+
+        (invoke #$(file-append skribilo "/bin/skribilo")
+                (string-append "--preload=" #$(file-append guix-forge-source "/doc/skribilo.scm"))
+                (string-append "--output=" #$output)
+                #$(file-append guix-forge-source "/website/index.skb")))))
+
+(define guix-forge-website-manual-en-gexp
+  (with-imported-modules '((guix build utils))
+    #~(begin
+        (use-modules (guix build utils))
+
+        (chdir #$guix-forge-source)
+        (invoke #$(file-append skribilo "/bin/skribilo")
+                (string-append "--preload="
+                               #$(file-append guix-forge-source "/doc/skribilo.scm"))
+                (string-append "--source-path=" #$guix-forge-source)
+                (string-append "--output=" #$output)
+                #$(file-append guix-forge-source "/doc/forge.skb")))))
+
+(define-public guix-forge-website
+  (file-union "guix-forge-website"
+              `(("index.html"
+                 ,(computed-file "guix-forge-website-home-page"
+                                 guix-forge-website-home-page-gexp))
+                ("manual/dev/en/index.html"
+                 ,(computed-file "guix-forge-website-manual-en"
+                                 guix-forge-website-manual-en-gexp))
+                ("style.css"
+                 ,(file-append guix-forge-source
+                               "/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")))))
+
+guix-forge-website