[feat/garden] filter headline on publish

This commit is contained in:
SouthFox 2024-10-03 03:12:36 +08:00
parent 4abd34b8b4
commit b6632ce378

View file

@ -234,7 +234,18 @@
(org-roam-update-org-id-locations)
(org-roam-set-keyword "filetags" ":publish:")
(save-buffer)
(org-hugo-export-wim-to-md)
(let ((publish-content (buffer-string)))
(with-current-buffer (get-buffer-create "*Garden*")
(erase-buffer)
(insert publish-content)
(org-mode)
(org-roam-set-keyword "EXPORT_FILE_NAME" (cadar (org-collect-keywords '("title"))))
(if-let ((headline (org-find-exact-headline-in-buffer "总结")))
(progn
(goto-char headline)
(org-cut-subtree)))
(org-hugo-export-wim-to-md)))
(async-shell-command (concat
"cd " org-hugo-base-dir
" && " "git add ."