diff --git a/data/scripts/generate-gemlog.lisp b/data/scripts/generate-gemlog.lisp index 57d4f9c..ba3f5a5 100644 --- a/data/scripts/generate-gemlog.lisp +++ b/data/scripts/generate-gemlog.lisp @@ -178,7 +178,7 @@ (a:when-let ((topics (post-topics post))) (loop for topic in topics do (pushnew topic results :test #'string-equal))))) - results)) + (sort results #'string<))) (defun post-date (post) (with-accessors ((meta meta)) post @@ -186,22 +186,22 @@ (defun sexp->gmi (parsed stream) (loop for node in parsed do - (let ((line (cond + (let* ((child (first (children node))) + (line (cond ((tag= :h1 node) - (geminize-h1 (first (children node)))) + (geminize-h1 child)) ((tag= :h2 node) - (geminize-h2 (first (children node)))) + (geminize-h2 child)) ((tag= :h3 node) - (geminize-h3 (first (children node)))) + (geminize-h3 child)) ((tag= :li node) - (geminize-list (first (children node)))) + (geminize-list child)) ((tag= :quote node) - (geminize-quote (first (children node)))) + (geminize-quote child)) ((tag= :a node) - (geminize-link (strcat " " - (attribute-value (find-attribute :href node)) + (geminize-link (strcat (attribute-value (find-attribute :href node)) " " - (first (children node))))) + child))) ((or (tag= :pre node) (tag= :pre-end node)) "```")