diff options
author | Colin Okay <okay@toyful.space> | 2021-05-18 07:31:44 -0500 |
---|---|---|
committer | Colin Okay <okay@toyful.space> | 2021-05-18 07:31:44 -0500 |
commit | d17133f047ee83c0e95952284810dfca54cfed84 (patch) | |
tree | 7b2d457f41b16cc858d5db953b5a8fc7d232fc21 | |
parent | 2d508a8890157f69a60db9905ff167612614c8a5 (diff) |
added *host* dynamic variable
-rw-r--r-- | flexo.lisp | 10 | ||||
-rw-r--r-- | package.lisp | 1 |
2 files changed, 9 insertions, 2 deletions
@@ -18,6 +18,10 @@ "Dynamic hash-table, bound before building a site. A collection of artifacts, indexed by the url path of the artifact.") +(defvar *host* nil + "Dynamic string, bound before building a site, that holds the url of + the host, including the transfer protocol (https/http/etc).") + ;;; HACKING ON A SITE (defgeneric content-equivlanet-p (a b) @@ -118,6 +122,7 @@ artifact tables have changed." (bt:make-thread (lambda () (let ((*auto-refresh-key* (when auto-refresh (make-auto-refresh-key))) + (*host* (format nil "http://localhost:~a" port)) (the-site (run-recipe recipe))) (format t "Start Hacking on localhost port ~a~%" port) (loop :while (hunchentoot:started-p *development-acceptor*) @@ -431,9 +436,10 @@ artifact tables have changed." (loop for artifact being the hash-value of site do (publish artifact location))) -(defun build-and-publish (recipe location) +(defun build-and-publish (recipe location host) "RECIPE is a function of zero arguments that builds a site in a fresh context and, if successful, publishes that site to LOCATION. Calls PUBLISH under the hood on each ARTIFACT created in the recipe." - (publish-site (run-recipe recipe) location)) + (let ((*host* host)) + (publish-site (run-recipe recipe) location))) diff --git a/package.lisp b/package.lisp index 80441b7..e480776 100644 --- a/package.lisp +++ b/package.lisp @@ -6,6 +6,7 @@ #:with-html #:with-html-string) (:export + #:*host* #:add-file #:add-files-matching #:artifact |