Serve the README.html file on the site

This commit is contained in:
Christopher Baines 2019-09-21 12:41:39 +01:00
parent f5ff0f8638
commit 1181d999a9
3 changed files with 31 additions and 0 deletions

View File

@ -30,6 +30,13 @@
(if (file-exists? install-dir)
install-dir
dev-dir)))
(doc-dir . ,(let ((install-dir
"@prefix@/share/doc/guix-data-service")
(dev-dir
(getcwd)))
(if (file-exists? install-dir)
install-dir
dev-dir)))
(host . "localhost")
(port . 8765)

View File

@ -720,6 +720,9 @@
#t)
200
500))))
(('GET "README")
(render-html
#:sxml (readme)))
(_
(with-postgresql-connection
"web"

View File

@ -23,12 +23,14 @@
#:use-module (guix-data-service web util)
#:use-module (ice-9 vlist)
#:use-module (ice-9 match)
#:use-module (ice-9 textual-ports)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-19)
#:use-module (texinfo)
#:use-module (texinfo html)
#:use-module (json)
#:export (index
readme
general-not-found
unknown-revision
view-statistics
@ -221,6 +223,25 @@
'())))
'())))))
(define (readme)
(layout
#:body
`(,(header)
(div
(@ (class "container"))
(div
(@ (class "row"))
(div
(@ (class "col-sm-12"))
(h1 "The README document")))
(div
(@ (class "row"))
(div
(@ (class "col-sm-12"))
(raw ,(call-with-input-file
(string-append (%config 'doc-dir) "/README.html")
get-string-all))))))))
(define (index git-repositories-and-revisions)
(layout
#:body