Commit 490fd199 authored by Dave Cooper's avatar Dave Cooper

Separated the test server out from the main make command

parent 136bc824
all: build
serve: static favicon
sbcl --load build.lisp
sbcl --load test-serve.lisp
static:
mkdir -p output/static
......
......@@ -50,9 +50,7 @@ in `layout/static/` takes precedence.
## Execution
### From command line
Using Make.
### From command line, using make:
The Makefile contains various useful commands.
......@@ -64,42 +62,33 @@ Among them:
* `make pyserve` - to run a secondary (python) server on port 8000 (crashes if 8000 is busy).
### From Lisp
(The following assumes you have a reasonably recent Quicklisp loaded)
* Either (in one fell swoop):
* To generate the static pages:
(load ".../cl-site/build.lisp") ;; replace with your actual path to cl-site/
This will also start serving the site on port 8008 (or subsequent port
numbers, if 8008 is busy). So you can visit the site to test it at:
`http://localhost:8008`
This will load the site-generating code and generate the static pages into `output/`
* Or (step by step):
First, make sure your `cl-site/` directory (the directory containing
this file) is pushed onto `ql:*local-project-directories*` or you
have this directory moved or linked under your
`quicklisp/local-projects/` directory (see `build.lisp` for example
of how to push onto `ql:*local-project-directories*`).
* To generate the static pages and start the test server:
Then, load the system with this command:
(load ".../cl-site/test-serve.lisp") ;; replace with your actual path to cl-site/
(ql:quickload :cl-site)
This will start serving the site on port 8008 (or subsequent port
numbers, if 8008 is busy).
To generate the site:
### Known Problems
(cl-site:make-site)
The test server crashes on load with `invalid number of arguments` on
certain 1.3.1 releases of SBCL (apparently a problem with the
`ironclad` library from quicklisp with this sbcl version). If you get
this error, try upgrading your SBCL or use CCL.
The output files will be generated in the `output/` directory.
To clean any old files from output/ directory:
(cl-site:make-clean)
......@@ -8,12 +8,6 @@
(ql:quickload :cl-site)
(cl-site::make-site)
(cl-site:make-site)
;;
;; Start aserve, publish site directory & pages, set default package.
;;
(cl-site:start-aserve)
(cl-site:publish-cl-site)
(setq *package* (find-package :cl-site))
;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
(in-package :cl-user)
(asdf:defsystem cl-site-test-serve
:name "cl-site-test-serve"
:version "0.0.1"
:maintainer "Common-Lisp.Net maintainers"
:author "Dave Cooper & Common-Lisp.Net maintainers"
:licence "TBD"
:description "Test server for common-lisp.net, written in CL"
:depends-on (:cl-site :aserve)
:components ((:module source
:pathname ""
:serial t
:components ((:file "publish")))))
......@@ -8,7 +8,7 @@
:author "C. Yang & Common-Lisp.Net maintainers"
:licence "TBD"
:description "Static site generator for common-lisp.net, written in CL"
:depends-on (:cl-mustache :plump :markdown.cl :closer-mop :cl-who :cl-yaml :aserve)
:depends-on (:cl-mustache :plump :markdown.cl :closer-mop :cl-who :cl-yaml)
:components ((:module source
:pathname ""
:serial t
......@@ -16,8 +16,7 @@
:components ((:file "globals")
(:file "helpers")
(:file "process")
(:file "main")
(:file "publish")))
(:file "main")))
(:module package
:pathname ""
:components ((:file "package"))))
......
(in-package :cl-user)
(uiop:with-current-directory (*load-truename*)
(load "build"))
(ql:quickload :cl-site-test-serve)
;;
;; Start aserve, publish site directory & pages, set default package.
;;
(cl-site:start-aserve)
(cl-site:publish-cl-site)
(setq *package* (find-package :cl-site))
(let ((wserver net.aserve:*wserver*))
(when wserver
;; FLAG replace with `usocket:get-local-port` after upgrading to zaserve.
(let ((port (acl-compat.socket::port(net.aserve:wserver-socket wserver))))
(format t "You may now visit http://localhost:~a to test the site.~%" port))))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment