;; Maintainer: Eshel Yaron <me@eshelyaron.com>
;; Keywords: languages extensions
;; URL: http://git.eshelyaron.com/gitweb/?p=esy-publish.git
-;; Package-Version: 0.6.0
+;; Package-Version: 0.7.0
;; Package-Requires: ((emacs "28.2"))
;; This file is NOT part of GNU Emacs.
(with-current-buffer
(find-file-noselect
(expand-file-name "esy.org" esy-publish-source-directory))
- (org-transclusion-add-all)))
+ (org-transclusion-add-all)
+ (push (current-buffer) esy-publish--buffers)))
(defun esy-publish--prepare-indices (&rest _)
(dolist (dir (list esy-publish-notes-source-directory
esy-publish-posts-source-directory
esy-publish-source-directory))
(with-current-buffer (find-file-noselect (expand-file-name "index.org" dir))
- (org-update-all-dblocks))))
+ (org-update-all-dblocks)
+ (push (current-buffer) esy-publish--buffers))))
(defun esy-publish--prepare-notes-links (&rest _)
(dolist (note (delete "index.org"
(rx bos alnum (+ any)
".org" eos))))
(with-current-buffer (find-file-noselect note)
- (org-update-all-dblocks))))
+ (org-update-all-dblocks)
+ (push (current-buffer) esy-publish--buffers))))
(defun esy-publish--prepare (&rest _)
(esy-publish--transclude-config)
(replace-match (format "<link rel=\"canonical\" href=\"%s\" />"
(esy-publish--file-url file))
nil t))
- (basic-save-buffer))))
+ (basic-save-buffer)
+ (push (current-buffer) esy-publish--buffers))))
(defun esy-publish--finalize (plist)
(esy-publish--add-canonical-tags plist)
(esy-publish--finalize-feed plist)
(esy-publish--finalize-sitemap plist))
+(defvar esy-publish--buffers nil)
+
;;;###autoload
(defun esy-publish (&optional force)
(interactive "P")
(org-src-lang-modes nil)
(prog-mode-hook '(rainbow-delimiters-mode))
(make-backup-files nil)
+ (auto-save-default nil)
+ (esy-publish--buffers nil)
(org-publish-project-alist
(list '("all" :components ("assets" "org"))
(list "assets"
"© "
(time ((class . "copyright-year")) "2023")
" %a"))))))))
- (org-publish "all" force)))
+ (org-publish "all" force)
+ (dolist (buffer esy-publish--buffers)
+ (kill-buffer)))
+ (setq esy-publish--buffers nil))
(defun esy-publish-all ()
(esy-publish t))