Serve the README.html file on the site
This commit is contained in:
parent
f5ff0f8638
commit
1181d999a9
3 changed files with 31 additions and 0 deletions
|
|
@ -30,6 +30,13 @@
|
||||||
(if (file-exists? install-dir)
|
(if (file-exists? install-dir)
|
||||||
install-dir
|
install-dir
|
||||||
dev-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")
|
(host . "localhost")
|
||||||
(port . 8765)
|
(port . 8765)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -720,6 +720,9 @@
|
||||||
#t)
|
#t)
|
||||||
200
|
200
|
||||||
500))))
|
500))))
|
||||||
|
(('GET "README")
|
||||||
|
(render-html
|
||||||
|
#:sxml (readme)))
|
||||||
(_
|
(_
|
||||||
(with-postgresql-connection
|
(with-postgresql-connection
|
||||||
"web"
|
"web"
|
||||||
|
|
|
||||||
|
|
@ -23,12 +23,14 @@
|
||||||
#:use-module (guix-data-service web util)
|
#:use-module (guix-data-service web util)
|
||||||
#:use-module (ice-9 vlist)
|
#:use-module (ice-9 vlist)
|
||||||
#:use-module (ice-9 match)
|
#:use-module (ice-9 match)
|
||||||
|
#:use-module (ice-9 textual-ports)
|
||||||
#:use-module (srfi srfi-1)
|
#:use-module (srfi srfi-1)
|
||||||
#:use-module (srfi srfi-19)
|
#:use-module (srfi srfi-19)
|
||||||
#:use-module (texinfo)
|
#:use-module (texinfo)
|
||||||
#:use-module (texinfo html)
|
#:use-module (texinfo html)
|
||||||
#:use-module (json)
|
#:use-module (json)
|
||||||
#:export (index
|
#:export (index
|
||||||
|
readme
|
||||||
general-not-found
|
general-not-found
|
||||||
unknown-revision
|
unknown-revision
|
||||||
view-statistics
|
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)
|
(define (index git-repositories-and-revisions)
|
||||||
(layout
|
(layout
|
||||||
#:body
|
#:body
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue