commit b2d35ce5ad2c5ed3543d8bc898fa9801a9c1f1c6
parent e0f607218e8ed82c3b758b1fa90d5043d8dddaec
Author: Decay <decaydjk@tilde.town>
Date: Sat, 8 Feb 2020 19:36:25 +0000
Initialize the default template as a top level form
This way it can be packaged in a binary
Diffstat:
3 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/src/content.lisp b/src/content.lisp
@@ -1,5 +1,11 @@
(in-package :miniblog.content)
+(let ((this-file #.(or *compile-file-truename* *load-truename*)))
+ (register-emb "default-template"
+ (make-pathname :name "template" :type "lhtml"
+ :directory (pathname-directory this-file)
+ :defaults this-file)))
+
(defun make-generator (&optional title)
(lambda (entries &key year month archive-date-list tz)
(execute-emb
@@ -14,13 +20,6 @@
:short-date-formatter (miniblog.format:make-short-date-formatter (or tz *default-timezone*))
:long-date-formatter (miniblog.format:make-long-date-formatter (or tz *default-timezone*))))))
-(defun init-generator ()
- (let ((this-file #.(or *compile-file-truename* *load-truename*)))
- (register-emb "default-template"
- (make-pathname :name "template" :type "lhtml"
- :directory (pathname-directory this-file)
- :defaults this-file))))
-
(defun year-month-of-entry (entry &key tz)
(if (not entry)
(error "Entry cannot be nil")
diff --git a/src/miniblog.lisp b/src/miniblog.lisp
@@ -34,7 +34,6 @@
(uiop:getenv "USER"))
(defun make-generator (&optional title)
- (miniblog.content:init-generator)
(setf *generator* (miniblog.content:make-generator title)))
(defun get-index-file-for-path (path)
diff --git a/src/packages.lisp b/src/packages.lisp
@@ -17,7 +17,7 @@
(defpackage :miniblog.content
(:use :cl :local-time :cl-emb)
- (:export #:make-generator #:init-generator
+ (:export #:make-generator
#:year-month-of-entry #:year-month-of-latest-entry
#:gen-all #:gen-index #:gen-year #:gen-month))