summaryrefslogtreecommitdiff
path: root/tissue.scm
blob: 7d0291d258dacb0f05552efdf7a55d173f25deea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
(import (tissue tissue))

(define %github-repo-uri
  "https://github.com/genenetwork/gn-gemtext-threads")

(define %repo-branch
  "main")

(define (genenetwork-gemtext-reader file)
  (lambda (port)
    (match ((gemtext-reader) port)
      ((? eof-object? eof) eof)
      (('document body ...)
       `(document
         (ref #:url ,(string-append %github-repo-uri "/edit/" %repo-branch "/" file)
              #:text "Edit this page")
         " | "
         (ref #:url ,(string-append %github-repo-uri "/blame/" %repo-branch "/" file)
              #:text "Blame")
         ,@body)))))

(tissue-configuration
 #:project "GeneNetwork issue tracker"
 #:aliases '(("Alexander Kabui" "Alexander" "alex" "alexk")
             ("Arun Isaac" "aruni")
             ("BonfaceKilz" "Bonface Kilz" "bonfacem")
             ("Efraim Flashner" "efraimf")
             ("Erik Garrison" "erikg")
             ("Frederick Muriuki Muriithi" "Muriithi Frederick Muriuki" "fredm" "fred")
             ("Pjotr Prins" "pjotrp")
             ("Rob Williams" "robw")
             ("Arthur Centeno" "acenteno")
             ("jgart")
             ("Zachary Sloan" "zach" "zachs" "zsloan"))
 #:indexed-documents (append (map (lambda (filename)
                                    (indexed-document (cut read-gemtext-issue filename)
                                                      (string-append "/" (string-remove-suffix ".gmi" filename))))
                                  (gemtext-files-in-directory "issues"))
                             (map (lambda (filename)
                                    (indexed-document (cut read-gemtext-document filename)
                                                      (string-append "/" (string-remove-suffix ".gmi" filename))))
                                  (gemtext-files-in-directory "topics")))
 #:web-css "/style.css"
 #:web-files (cons* (file "style.css"
                          (copier "style.css"))
                    (filter-map (lambda (filename)
                                  (cond
                                   ((and (string-suffix? ".gmi" filename)
                                         (not (string=? (basename filename)
                                                        "README.gmi")))
                                    (file (replace-extension filename "html")
                                          (gemtext-exporter filename
                                                            (genenetwork-gemtext-reader filename))))
                                   ((or (string-suffix? ".jpg" filename)
                                        (string-suffix? ".png" filename)
                                        (string-suffix? ".svg" filename))
                                    (file filename
                                          (copier filename)))
                                   (else #f)))
                                (git-tracked-files))))