authoring server 3
All checks were successful
Build Org Website / build (push) Successful in 1m1s

This commit is contained in:
2026-05-07 13:46:25 +01:00
parent d3a668f353
commit d33e1771af
11 changed files with 295 additions and 37 deletions

View File

@@ -414,6 +414,15 @@ Created with %c on <a href=\"https://www.archlinux.org/\">Arch</a> \
(make-directory target t)
(copy-directory d target t t t)))))
(defun z/markdown-h1-title (filename fallback)
"Return the first Markdown H1 title in FILENAME, or FALLBACK."
(with-temp-buffer
(insert-file-contents filename nil 0 4096)
(goto-char (point-min))
(if (re-search-forward "^# +\\(.+?\\)\\s-*$" nil t)
(match-string 1)
fallback)))
(defun z/publish-lima-file (plist filename pub-dir)
"Publish an Org or Markdown file from the lima directory."
(let* ((ext (downcase (or (file-name-extension filename) "")))
@@ -440,7 +449,7 @@ Created with %c on <a href=\"https://www.archlinux.org/\">Arch</a> \
(insert-file-contents temp-org)
(goto-char (point-min))
(insert (format "#+TITLE: %s\n#+OPTIONS: num:nil\n#+DATE: %s\n#+COMMENTS: t\n#+SLUG: %s\n\n"
base
(z/markdown-h1-title filename base)
(format-time-string "<%Y-%m-%d %a %H:%M>")
base))
(write-region (point-min) (point-max) temp-org))
@@ -491,7 +500,7 @@ Created with %c on <a href=\"https://www.archlinux.org/\">Arch</a> \
("org-assets"
:base-directory ,(site-path "assets/")
:base-extension "css\\|js\\|png\\|jpg\\|gif\\|svg\\|pdf\\|woff\\|woff2\\|ttf"
:base-extension "css\\|js\\|png\\|jpg\\|jpeg\\|gif\\|webp\\|svg\\|pdf\\|mp4\\|webm\\|mov\\|woff\\|woff2\\|ttf"
:publishing-directory ,(site-path "output/assets/")
:recursive t
:publishing-function org-publish-attachment)