1b8e60337175dddab28b0609b5a6656fbaa5f4f7 — Nick Econopouly a month ago b096fab
Fix incorrect ordering on agregate pages and implement the media folder.

Due to some silliness with the "merge-pathnames" function, I
temporarily changed the behaviour of how betterssg copies the media
folder. Also, the list of subpages on an agregate pages is now ordered
by alphabetical order (which orders by date if you use the yyyy-mm-dd
format), instead of relying on the ordering of your files in
"uiop:directory-files".
3 files changed, 8 insertions(+), 16 deletions(-)

M betterssg.asd
M betterssg.lisp
M config.lisp
M betterssg.asd => betterssg.asd +2 -2
@@ 2,8 2,8 @@ :author "Nick Econopouly <wry@mm.st>"
    :maintainer "Nick Econopouly <wry@mm.st>"
    :license "MIT"
-   :homepage "https://github.com/wrycode/betterssg"
-   :version "0.1"
+   :homepage "https://git.sr.ht/~wrycode/betterssg"
+   :version "0.4.0"
    :depends-on (:cl-markdown :cl-ppcre :str :copy-directory)
    :components ((:file "betterssg"))
    :description "A better static site generator"

M betterssg.lisp => betterssg.lisp +6 -13
@@ 26,19 26,11 @@ (defun set-variables (&key       (content-folder "content/default/")
                          (layout-folder "layout/default/")
                          (website-folder "website/")
-                         (media-folder "media/")
-                         ;; (rss t)
-                         ;; (title-case "up")
-                         ;; (sitemap t)
-                         )
+                         (media-folder "media/"))
    (defparameter *website-folder* (merge-pathnames website-folder *default-pathname-defaults*))
    (defparameter *content-folder* (merge-pathnames content-folder *default-pathname-defaults*)) 
    (defparameter *layout-folder*  (merge-pathnames layout-folder *default-pathname-defaults*))
-   (defparameter *media-folder*   (merge-pathnames media-folder *default-pathname-defaults*))
-   ;; (defparameter *rss* rss)
-   ;; (defparameter *title-case* title-case)
-                         ;; (defparameter *sitemap* sitemap)
-                         )
+   (defparameter *media-folder* media-folder))
  
  (defun main ()
    (apply-config)


@@ 58,7 50,7 @@ (str:to-file (get-new-pathname aggregate-page) (build-aggregate-page aggregate-page)))
  
                                          ; copy misc files/folders stored in *media-folder* into *website-folder*
-   (copy-directory:copy *media-folder* (merge-pathnames *media-folder* *website-folder*))
+   (copy-directory:copy (merge-pathnames *media-folder* *default-pathname-defaults*) (pathname (concatenate 'string (namestring *website-folder*) *media-folder*)))
    (fresh-line)
    )
  


@@ 129,8 121,9 @@            ;; Every page in the sub-directory gets added to a
           ;; simple html list, which goes in {{content}}, in this case
-          (content 
-           (let* ((pages (reverse (uiop:directory-files aggregate-page)))
+          (content
+           ;; list of subpages in alphabetical order
+           (let* ((pages (mapcar #'pathname (sort (mapcar #'namestring (uiop:directory-files aggregate-page)) #'string>=)))
                   (html-content "<ul>"))
              (dolist (page pages)
                                          ; build the <a href="/link" for each page

M config.lisp => config.lisp +0 -1
@@ 4,5 4,4 @@ :content-folder "content/default/"
  :layout-folder "layout/default/"
  :website-folder "website/"
- :media-folder "media/"
  )