1
0
mirror of https://codeberg.org/cage/tinmop/ synced 2024-12-18 23:22:52 +01:00

- [script] capitalized gemlog link labels.

This commit is contained in:
cage 2024-12-14 15:10:53 +01:00
parent 6af9af8e83
commit 838ba097a4

View File

@ -345,11 +345,18 @@
(defun write-links (posts stream) (defun write-links (posts stream)
(flet ((clean-link-filename (filename) (flet ((clean-link-filename (filename)
(cl-ppcre:regex-replace "\\.gmi$" (let* ((basename (cl-ppcre:regex-replace "\\.gmi$" filename ""))
(cl-ppcre:regex-replace-all "-" (words (cl-ppcre:split "-" basename))
filename (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 (loop for post in posts do
(let* ((filename (strip-dirs-from-path (archive-file-path post))) (let* ((filename (strip-dirs-from-path (archive-file-path post)))
(relative-archive-path (strcat *uri-path-prefix* (relative-archive-path (strcat *uri-path-prefix*