summaryrefslogtreecommitdiff
path: root/tissue.scm
blob: 24fbd92b2b99aff18f859a4c6646fbe85f2ebd2d (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
(use-modules (tissue skribilo)
             (tissue web themes default))

(define %css
  "/style.css")

(define %engine
  (html-engine #:css %css))

(tissue-configuration
 #:indexed-documents (append (map (lambda (filename)
                                    (slot-set (read-gemtext-issue filename)
                                              'web-uri
                                              (string-append "/" (string-remove-suffix ".gmi" filename))))
                                  (gemtext-files-in-directory "issues"))
                             (map (lambda (identifier)
                                    (slot-set (document-fragment "doc/tissue.skb" identifier)
                                              'web-uri
                                              (string-append "/manual/dev/en/#"
                                                             identifier)))
                                  (list "chapter-introduction"
                                        "chapter-tutorial"
                                        "chapter-gemtext-markup"
                                        "section-constructors"
                                        "section-reader-functions"
                                        "section-writer-functions"
                                        "section-utility-functions"))
                             (map (lambda (commit)
                                    (slot-set commit
                                              'web-uri
                                              (string-append "https://git.systemreboot.net/tissue/commit/?id="
                                                             (commit-hash commit))))
                                  (commits-in-current-repository)))
 #:web-search-renderer (default-theme #:css %css)
 #:web-files (cons* (file "index.html"
                          (skribe-exporter "website/index.skb" #:engine %engine))
                    (file "style.css"
                          (copier "website/style.css"))
                    (file "manual/dev/en/index.html"
                          (skribe-exporter "doc/tissue.skb" #:engine %engine))
                    (append (map (lambda (font-file)
                                   (file (string-append "fonts/" font-file)
                                         (copier (string-append (getenv "GUIX_ENVIRONMENT")
                                                                "/share/fonts/web/" font-file))))
                                 (list "IBMPlexSans-Regular-Latin1.woff2"
                                       "IBMPlexSans-Bold-Latin1.woff2"
                                       "IBMPlexMono-Regular-Latin1.woff2"
                                       "IBMPlexMono-Bold-Latin1.woff2"))
                            (filter-map (lambda (release-file)
                                          (and (string-prefix? "website/releases/" release-file)
                                               (file (string-append "releases/" (basename release-file))
                                                     (copier release-file))))
                                        (git-tracked-files (current-git-repository)))
                            (map (lambda (filename)
                                   (file (replace-extension filename "html")
                                         (gemtext-exporter filename #:engine %engine)))
                                 (gemtext-files-in-directory "issues")))))