diff --git a/data/scripts/generate-gemlog.lisp b/data/scripts/generate-gemlog.lisp index 0eaa4a5..252c162 100644 --- a/data/scripts/generate-gemlog.lisp +++ b/data/scripts/generate-gemlog.lisp @@ -345,11 +345,18 @@ (defun write-links (posts stream) (flet ((clean-link-filename (filename) - (cl-ppcre:regex-replace "\\.gmi$" - (cl-ppcre:regex-replace-all "-" - filename - " ") - ""))) + (let* ((basename (cl-ppcre:regex-replace "\\.gmi$" filename "")) + (words (cl-ppcre:split "-" basename)) + (capitalized-words (loop for ct from 0 + for word in words + collect + (if (or (= ct 0) + (> (length word) 3)) + (let ((first-char (string-capitalize (elt word 0)))) + (text-utils:strcat first-char + (subseq word 1))) + word)))) + (text-utils:join-with-strings capitalized-words " ")))) (loop for post in posts do (let* ((filename (strip-dirs-from-path (archive-file-path post))) (relative-archive-path (strcat *uri-path-prefix*