From 7223d504ecf2b2f93992154b72a823ddabbcad49 Mon Sep 17 00:00:00 2001 From: Yaroslav Khnygin Date: Tue, 29 Oct 2024 02:13:27 +0000 Subject: [PATCH] Add the "stop" command. --- docs/changelog.lisp | 1 + docs/making-a-static-site.lisp | 6 ++++++ src/main.lisp | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/docs/changelog.lisp b/docs/changelog.lisp index a21a05f..d3d53cc 100644 --- a/docs/changelog.lisp +++ b/docs/changelog.lisp @@ -11,6 +11,7 @@ "HTTP")) (0.3.1 2024-10-29 "* `stop` function was exported and `serve` function was extended to return the server handler. + * `stop` command was added. * A typo was fixed in the documentation.") (0.3.0 2024-05-27 "* Field `url` was added to `content` objects of type `post` and `page`. It contains a full URL of the page and can be used as `canonical` URL in templates.") diff --git a/docs/making-a-static-site.lisp b/docs/making-a-static-site.lisp index f721a19..70e348e 100644 --- a/docs/making-a-static-site.lisp +++ b/docs/making-a-static-site.lisp @@ -195,6 +195,12 @@ CL-USER> (staticl:stop) ; No values ``` +Or from the command line: + +```bash +$ staticl serve +``` + ## How to add comments using Disqus diff --git a/src/main.lisp b/src/main.lisp index ba37fb8..b56583d 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -94,3 +94,7 @@ port) (uiop:quit 1))) :interface interface)) + +(defcommand (main stop) () + "Stops the web server." + (staticl:stop))