Recently Written · git

recentlywritten

my writings (done recently)

git clone https://github.com/equwal/recentlywritten

Log | Files | Refs


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> &middot; <a href="../../index.html">git</a></div>
8 <h1>cl-yag</h1><span class="desc">Mirror and rewrite of Solène Rapenne&#x27;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 &lt;truex@equwal.com&gt;
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 &quot;packages&quot;)
28                 (:file &quot;generators-util&quot;)
29 <span class="a">+               (:file &quot;generator-aux-pre&quot;)</span>
30                 (:file &quot;generators/html&quot;)
31                 (:file &quot;generators/gopher&quot;)
32                 (:file &quot;generators/gemini&quot;)
33 <span class="d">-               (:file &quot;generator-aux-pre&quot;)</span>
34                 (:file &quot;data/articles&quot;)
35                 (:file &quot;generator-aux&quot;)
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 &amp;body code)</span>
46 <span class="d">-  &quot;Simplify the declaration of a new page type by loading a template and executing code.&quot;</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(&amp;body code)</span>
53 <span class="d">-  &quot;Get the converter object for an article and execute code in that context.&quot;</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    &quot;Format a date using the given format string with template substitutions.&quot;
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 &amp;body code)</span>
73 <span class="a">+  &quot;Simplify the declaration of a new page type by loading a template and executing code.&quot;</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 &quot;%%Body%%&quot; body)
86  	   output))
87  
88 <span class="d">-;; simplify the file saving by using the layout</span>
89 <span class="d">-(defmacro generate(name &amp;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 &amp;optional &amp;key (tiny t) (no-text nil))</pre>
97 </div></body></html>