diff options
| -rw-r--r-- | games.scm | 6 | ||||
| -rw-r--r-- | haunt.scm | 4 | ||||
| -rw-r--r-- | theme.scm | 20 |
3 files changed, 28 insertions, 2 deletions
diff --git a/games.scm b/games.scm new file mode 100644 index 0000000..78d89c8 --- /dev/null +++ b/games.scm @@ -0,0 +1,6 @@ +(define-module (games) + #:use-module (theme) + #:export (color-quiz-page)) + +(define color-quiz-page + (game-page "Color Quiz" "cq.js" "cq.html")) @@ -11,7 +11,8 @@ (haunt html) (haunt publisher rsync) (theme) - (reader)) + (reader) + (games)) (define post-prefix "post") @@ -53,6 +54,7 @@ #:blog-prefix "/blog/post") (flat-pages #:template flat-page-template) (static-directory "images") + color-quiz-page (lambda (site posts) (list (verbatim-artifact "style.css" "style.css")))) #:publishers (list (rsync-publisher #:destination "/usr/local/www/www-personal"))) @@ -2,11 +2,13 @@ #:use-module (haunt html) #:use-module (haunt site) #:use-module (haunt post) + #:use-module (haunt artifact) #:use-module (haunt builder blog) #:use-module (sxml xpath) #:export (hwebs-theme-blog hwebs-theme-now - flat-page-template)) + flat-page-template + game-page)) (define (post-uri post site prefix) (string-append "/" (or prefix "") "/" @@ -110,3 +112,19 @@ ((header "updated " (time ,(date->string*(post-date post)))) ,(post-sxml post))))) posts))))) + + +;;; GAMES +(define (static-page title file-name body) + (lambda (site posts) + (serialized-artifact file-name + ;; TODO: simplify this + (with-layout hwebs-theme-now site title body) + sxml->html))) + +(define (game-page name js file-name) + (define body + `((h1 ,name) + (script (@ (src ,js))) + (div (@ (id "app"))))) + (static-page name (string-append "games/" file-name) body)) |
