diff --git a/guix-hpc.scm b/guix-hpc.scm index 7d8ccaf227267de7820ba64bcff496ffa07965ed..920373e7d0da266d266adef617f87975e7b52ade 100644 --- a/guix-hpc.scm +++ b/guix-hpc.scm @@ -5,11 +5,31 @@ (define-module (guix-hpc) #:use-module (haunt page) + #:use-module (haunt site) #:use-module (sxml simple) #:use-module (haunt reader) #:use-module (haunt reader commonmark) - #:export (static-pages)) + #:export (base-url + image-url + css-url + post-url + static-pages)) + +(define (base-url . location) + (string-concatenate (cons "" location))) + +(define (image-url location) + (base-url "static/images" location)) + +(define (css-url location) + (base-url "static/css" location)) + +(define (post-url post site) + "Return the URL of POST, a Haunt blog post, for SITE." + (base-url (site-post-slug site post) ".html")) + + (define %cwd (and=> (assq-ref (current-source-location) 'filename) dirname)) diff --git a/haunt.scm b/haunt.scm index 26f3169b911197974f44b1d1901da57242f58347..7ba578e8049f829761ec5b82748087e6b3098766 100644 --- a/haunt.scm +++ b/haunt.scm @@ -21,19 +21,6 @@ (srfi srfi-19) (guix-hpc)) -(define (base-url . location) - (string-concatenate (cons "" location))) - -(define (image-url location) - (base-url "static/images" location)) - -(define (css-url location) - (base-url "static/css" location)) - -(define (post-url post site) - "Return the URL of POST, a Haunt blog post, for SITE." - (base-url (site-post-slug site post) ".html")) - (define (base-layout body) `((doctype "html") (html (@ (lang "en"))