summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2022-03-15 13:25:50 +0530
committerArun Isaac2022-03-15 13:25:50 +0530
commitf063144f7ebee902c93d500db53d3928f9fc0042 (patch)
tree54740faaa072a47423dc5273816267686fc864e5
parent95473c83b9884d96e510c7415ed794222f77c1b7 (diff)
downloadtissue-f063144f7ebee902c93d500db53d3928f9fc0042.tar.gz
tissue-f063144f7ebee902c93d500db53d3928f9fc0042.tar.lz
tissue-f063144f7ebee902c93d500db53d3928f9fc0042.zip
tissue: Allow override of auto-generated files in website.
* tissue/web.scm (build-website): Export auto-generated files first so
that user-created files can override them.
-rw-r--r--tissue/web.scm43
1 files changed, 23 insertions, 20 deletions
diff --git a/tissue/web.scm b/tissue/web.scm
index 7e06b40..b9c1b8d 100644
--- a/tissue/web.scm
+++ b/tissue/web.scm
@@ -187,7 +187,28 @@ places. TAGS-PATH is the path relative to the document root where the
 per-tag issue listings are put. It must begin with a /. If it is #f,
 per-tag issue listings are not generated."
   (mkdir-p output-directory)
-  ;; Export files.
+  ;; Export auto-generated files. We must do this before exporting
+  ;; user-created files to allow users to be able to override
+  ;; auto-generated files.
+  (parameterize ((%tags-path tags-path))
+    ;; Export home page listing all issues.
+    (let ((output-file (string-append output-directory "/index.html")))
+      (display (format "~a~%" output-file))
+      (build-issue-listing (reverse (issues)) output-file
+                           #:title title))
+    ;; Export per-tag listings.
+    (when tags-path
+      (for-each (lambda (tag)
+                  (let ((output-file (string-append output-directory
+                                                    tags-path "/" tag ".html")))
+                    (display (format "tag: ~a -> ~a~%" tag output-file))
+                    (build-issue-listing (reverse (filter (lambda (issue)
+                                                            (member tag (issue-keywords issue)))
+                                                          (issues)))
+                                         output-file
+                                         #:title title)))
+                (delete-duplicates (append-map issue-keywords (issues))))))
+  ;; Export user-created files.
   (call-with-input-pipe
    (lambda (port)
      (port-transduce
@@ -222,22 +243,4 @@ per-tag issue listings are not generated."
                              (find-engine 'html)))
                       (copy-file input-file output-file))))))
       rcons get-line port))
-   "git" "ls-files")
-  (parameterize ((%tags-path tags-path))
-    ;; Export index.
-    (let ((output-file (string-append output-directory "/index.html")))
-      (display (format "~a~%" output-file))
-      (build-issue-listing (reverse (issues)) output-file
-                           #:title title))
-    ;; Export per-tag listings.
-    (when tags-path
-      (for-each (lambda (tag)
-                  (let ((output-file (string-append output-directory
-                                                    tags-path "/" tag ".html")))
-                    (display (format "tag: ~a -> ~a~%" tag output-file))
-                    (build-issue-listing (reverse (filter (lambda (issue)
-                                                            (member tag (issue-keywords issue)))
-                                                          (issues)))
-                                         output-file
-                                         #:title title)))
-                (delete-duplicates (append-map issue-keywords (issues)))))))
+   "git" "ls-files"))