From 6e6ae491e7fb57ebb7ce29574b73d9983f7f8900 Mon Sep 17 00:00:00 2001 From: Yaroslav Khnygin Date: Tue, 29 Oct 2024 01:36:45 +0000 Subject: [PATCH 1/2] Export "stop" function. --- docs/changelog.lisp | 2 ++ docs/making-a-static-site.lisp | 13 +++++++++++++ src/core.lisp | 6 ++++-- src/server.lisp | 3 ++- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/docs/changelog.lisp b/docs/changelog.lisp index 8416d3b..8b72f5a 100644 --- a/docs/changelog.lisp +++ b/docs/changelog.lisp @@ -9,6 +9,8 @@ "ASDF" "REPL" "HTTP")) + (0.3.1 2024-10-29 + "* `stop` function was exported.") (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.") (0.2.0 2024-05-26 diff --git a/docs/making-a-static-site.lisp b/docs/making-a-static-site.lisp index a1bb80a..f721a19 100644 --- a/docs/making-a-static-site.lisp +++ b/docs/making-a-static-site.lisp @@ -154,8 +154,14 @@ CL-USER> (staticl:serve :root-dir #P"/tmp/my-site" Starting Clack server to serve site from /tmp/result/ Hunchentoot server is started. Listening on localhost:8001. +#S(CLACK.HANDLER::HANDLER + :SERVER :HUNCHENTOOT + :SWANK-PORT NIL + :ACCEPTOR #) ``` +It will return a web server handler. + Or from the command line: ```bash @@ -182,6 +188,13 @@ If you click on one of the posts, it will open in its entirety: Pay attention to the "Next" link in the lower right corner. All blog posts are linked to each other and this is also done thanks to a separate pipeline block: `(prev-next-links)'. This pipeline block adds metadata to each post, which is then available in the template. If you remove it, the links will disappear from the pages. +To stop your server, use the following command in REPL: + +```lisp +CL-USER> (staticl:stop) +; No values +``` + ## How to add comments using Disqus diff --git a/src/core.lisp b/src/core.lisp index 797c754..45f6fa1 100644 --- a/src/core.lisp +++ b/src/core.lisp @@ -6,10 +6,12 @@ (:import-from #:staticl/builder #:generate) (:import-from #:staticl/server - #:serve) + #:serve + #:stop) (:export #:generate #:new-site - #:serve)) + #:serve + #:stop)) (in-package #:staticl) diff --git a/src/server.lisp b/src/server.lisp index 0833d2b..359a416 100644 --- a/src/server.lisp +++ b/src/server.lisp @@ -28,7 +28,8 @@ (:import-from #:staticl/plugins/autoreload #:autoreload) (:export - #:serve)) + #:serve + #:stop)) (in-package #:staticl/server) (defvar *port* nil) From 51264370112b6281c5cb1eb573227224d5dfe371 Mon Sep 17 00:00:00 2001 From: Yaroslav Khnygin Date: Tue, 29 Oct 2024 01:56:52 +0000 Subject: [PATCH 2/2] Fixed a typo in the docs. --- docs/changelog.lisp | 3 ++- docs/index.lisp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/changelog.lisp b/docs/changelog.lisp index 8b72f5a..02d5f25 100644 --- a/docs/changelog.lisp +++ b/docs/changelog.lisp @@ -10,7 +10,8 @@ "REPL" "HTTP")) (0.3.1 2024-10-29 - "* `stop` function was exported.") + "* `stop` function was exported. + * 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.") (0.2.0 2024-05-26 diff --git a/docs/index.lisp b/docs/index.lisp index 2cfa745..603fcaf 100644 --- a/docs/index.lisp +++ b/docs/index.lisp @@ -168,7 +168,7 @@ Of course, we could look at static site generators in other programming language * Supports different themes. * Multiple templating engines might be used. * Many content formats are supported. Markdown is used by default, but you can easily use reStructured text, Spinneret or add your own. -* Plugins and themse can be hosted along with the content of your site. +* Plugins and themes can be hosted along with the content of your site. See also the STATICL-DOCS/ROADMAP::@ROADMAP section. ")