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:
parent
6af9af8e83
commit
838ba097a4
@ -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*
|
||||
|
Loading…
Reference in New Issue
Block a user