git/cl-yag/commit/a386ddb2979cd75bf9a4b7501830209de9e248d5.html (4615 bytes)
1 <!DOCTYPE html> 2 <html lang="en"><head><meta charset="UTF-8" /> 3 <meta name="viewport" content="width=device-width, initial-scale=1" /> 4 <title>cl-yag a386ddb2 - Recently Written</title> 5 <link rel="stylesheet" href="../../stagit.css" /> 6 </head><body> 7 <div id="top"><a href="../../../index.html">Recently Written</a> · <a href="../../index.html">git</a></div> 8 <h1>cl-yag</h1><span class="desc">Mirror and rewrite of Solène Rapenne's cl-yag SSG of renown</span><p class="url">git clone https://github.com/equwal/cl-yag</p><p><a href="../../cl-yag/index.html">Log</a> | <a href="../../cl-yag/files.html">Files</a> | <a href="../../cl-yag/refs.html">Refs</a></p><hr/> 9 <div id="content"> 10 <pre>commit a386ddb2979cd75bf9a4b7501830209de9e248d5 11 Spenser Truex <truex@equwal.com> 12 2025-09-01 16:38:10 -0400 13 14 Move macros to early loading 15 16 </pre><pre> cl-yag.asd | 2 +- 17 generator-aux.lisp | 15 --------------- 18 generators-util.lisp | 9 +++++++++ 19 generators/html.lisp | 6 ------ 20 4 files changed, 10 insertions(+), 22 deletions(-) 21 </pre><pre>diff --git a/cl-yag.asd b/cl-yag.asd 22 index b11ed99..fb09462 100644 23 --- a/cl-yag.asd 24 +++ b/cl-yag.asd 25 <span class="h">@@ -8,10 +8,10 @@</span> 26 :serial t 27 :components ((:file "packages") 28 (:file "generators-util") 29 <span class="a">+ (:file "generator-aux-pre")</span> 30 (:file "generators/html") 31 (:file "generators/gopher") 32 (:file "generators/gemini") 33 <span class="d">- (:file "generator-aux-pre")</span> 34 (:file "data/articles") 35 (:file "generator-aux") 36 )) 37 diff --git a/generator-aux.lisp b/generator-aux.lisp 38 index 6f4fb7a..2ff43af 100644 39 --- a/generator-aux.lisp 40 +++ b/generator-aux.lisp 41 <span class="h">@@ -48,21 +48,6 @@</span> 42 (with-open-file (stream path :direction :output :if-exists :supersede :if-does-not-exist :create) 43 (write-sequence data stream))) 44 45 <span class="d">-(defmacro prepare(template &body code)</span> 46 <span class="d">- "Simplify the declaration of a new page type by loading a template and executing code."</span> 47 <span class="d">- `(progn</span> 48 <span class="d">- (let ((output (load-file ,template)))</span> 49 <span class="d">- ,@code</span> 50 <span class="d">- output)))</span> 51 <span class="d">-</span> 52 <span class="d">-(defmacro with-converter(&body code)</span> 53 <span class="d">- "Get the converter object for an article and execute code in that context."</span> 54 <span class="d">- `(progn</span> 55 <span class="d">- (let ((converter-name (or (article-converter article)</span> 56 <span class="d">- (getf *config* :default-converter))))</span> 57 <span class="d">- (let ((converter-object (getf *converters* converter-name)))</span> 58 <span class="d">- ,@code))))</span> 59 <span class="d">-</span> 60 (defun date-format(format date) 61 "Format a date using the given format string with template substitutions." 62 (let ((output format)) 63 diff --git a/generators-util.lisp b/generators-util.lisp 64 index b4eeb26..3ea2ccf 100644 65 --- a/generators-util.lisp 66 +++ b/generators-util.lisp 67 <span class="h">@@ -18,3 +18,12 @@</span> 68 (getf *config* :default-converter)))) 69 (let ((converter-object (getf *converters* converter-name))) 70 ,@code)))) 71 <span class="a">+</span> 72 <span class="a">+(defmacro prepare(template &body code)</span> 73 <span class="a">+ "Simplify the declaration of a new page type by loading a template and executing code."</span> 74 <span class="a">+ `(progn</span> 75 <span class="a">+ (let ((output (load-file ,template)))</span> 76 <span class="a">+ ,@code</span> 77 <span class="a">+ output)))</span> 78 <span class="a">+</span> 79 <span class="a">+</span> 80 diff --git a/generators/html.lisp b/generators/html.lisp 81 index 1c5f06c..62ff036 100644 82 --- a/generators/html.lisp 83 +++ b/generators/html.lisp 84 <span class="h">@@ -85,12 +85,6 @@</span> 85 (template "%%Body%%" body) 86 output)) 87 88 <span class="d">-;; simplify the file saving by using the layout</span> 89 <span class="d">-(defmacro generate(name &body data)</span> 90 <span class="d">- `(progn</span> 91 <span class="d">- (save-file ,name (generate-layout ,@data))))</span> 92 <span class="d">-</span> 93 <span class="d">-</span> 94 ;; generates the html of only one article 95 ;; this is called in a loop to produce the homepage 96 (defun create-article(article &optional &key (tiny t) (no-text nil))</pre> 97 </div></body></html>