This commit is contained in:
2025-11-22 13:59:15 +08:00
parent fafe8f4ab5
commit 5d369dd3b5
4 changed files with 33 additions and 4 deletions
+6 -4
View File
@@ -121,10 +121,12 @@
(defun my/org-download-image-dir-setup ()
"Create and set org-download-image-dir relative to current org file."
(let* ((current-file-dir (file-name-directory (buffer-file-name)))
(image-dir (expand-file-name "images" current-file-dir)))
(make-directory image-dir t)
(setq-local org-download-image-dir image-dir)))
(let ((filename (buffer-file-name)))
(when filename
(let* ((current-file-dir (file-name-directory filename))
(image-dir (expand-file-name "images" current-file-dir)))
(make-directory image-dir t)
(setq-local org-download-image-dir image-dir)))))
(add-hook 'org-mode-hook #'my/org-download-image-dir-setup)
(setq org-download-link-format "[[file:%s]]\n")