From bc0ee663a7fb3df71cf1547455d9eb93007b4459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 30 Mar 2020 00:53:24 +0200 Subject: Fixed minor errors in HTML output. --- module/output/html.scm | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'module') diff --git a/module/output/html.scm b/module/output/html.scm index 6e64d176..454f9dc4 100644 --- a/module/output/html.scm +++ b/module/output/html.scm @@ -416,19 +416,24 @@ `(td (@ (class ,(when (date< date start-date) "prev ") ,(when (date< end-date date) "next "))) - (a (@ (href ,(cond [(date< date start-date) - ;; TODO find a prettier way to generate links to previous and next time intervals - ;; TODO also, it would do good with a bit of testing for off-by-one errors - (date->string - (stream-find (lambda (d) (date<= d date (next-start d))) - (stream-iterate prev-start start-date)) - "~Y-~m-~d.html")] - [(date< end-date date) - (date->string - (stream-find (lambda (d) (and (date<= d date) - (date< date (next-start d)))) - (stream-iterate next-start start-date)) - "~Y-~m-~d.html" )]) + (a (@ (href ,(cond + ;; We are before our time interval + [(date< date start-date) + ;; TODO find a prettier way to generate links to previous and next time intervals + ;; TODO also, it would do good with a bit of testing for off-by-one errors + (date->string + (stream-find (lambda (d) (date<= d date (next-start d))) + (stream-iterate prev-start start-date)) + "~Y-~m-~d.html")] + ;; We are after our time interval + [(date< end-date date) + (date->string + (stream-find (lambda (d) (and (date<= d date) + (date< date (next-start d)))) + (stream-iterate next-start start-date)) + "~Y-~m-~d.html" )] + ;; We are in our time interval + [else ""]) "#" ,(date->string date "~Y-~m-~d")) (class "hidelink")) ,(day date)))) @@ -489,7 +494,7 @@ (head (title "Calendar") (meta (@ (charset "utf-8"))) - (meta (@ (http-equiv "Content-Type") (content "application/xhtml+xml"))) + ;; (meta (@ (http-equiv "Content-Type") (content "application/xhtml+xml"))) (meta (@ (name viewport) (content "width=device-width, initial-scale=0.5"))) (meta (@ (name description) -- cgit v1.2.3