;; Maintainer: Eshel Yaron <me@eshelyaron.com>
;; Keywords: languages extensions
;; URL: http://git.eshelyaron.com/gitweb/?p=esy-publish.git
-;; Package-Version: 0.10.0
+;; Package-Version: 0.11.0
;; Package-Requires: ((emacs "28.2"))
;; This file is NOT part of GNU Emacs.
(let* ((file (expand-file-name note dir))
(buffer (find-file-noselect file))
(titles (with-current-buffer buffer
+ (when esy-publish--publishing
+ (push (current-buffer) esy-publish--buffers))
(org-collect-keywords '("TITLE" "SUBTITLE"))))
(title (car (alist-get "TITLE" titles nil nil #'string=)))
(subtitle (car (alist-get "SUBTITLE" titles nil nil #'string=))))
(dolist (file files)
(let* ((full (expand-file-name file dir))
(titles (with-current-buffer (find-file-noselect full)
+ (when esy-publish--publishing
+ (push (current-buffer) esy-publish--buffers))
(org-collect-keywords '("TITLE" "SUBTITLE"))))
(title (car (alist-get "TITLE" titles nil nil #'string=)))
(subtitle (car (alist-get "SUBTITLE" titles nil nil #'string=))))
#'string=)
"org")
esy-publish-notes-source-directory))
+ (when esy-publish--publishing
+ (push (current-buffer) esy-publish--buffers))
(car (alist-get "SUBTITLE"
(org-collect-keywords
'("SUBTITLE"))
(defvar esy-publish--buffers nil)
+(defvar esy-publish--publishing nil)
+
;;;###autoload
(defun esy-publish (&optional force)
(interactive "P")
(org-export-with-section-numbers nil)
(org-export-with-toc nil)
(org-export-with-smart-quotes t)
+ (org-export-time-stamp-file nil)
(org-html-htmlize-output-type 'css)
(org-html-metadata-timestamp-format "%Y-%m-%d")
(org-time-stamp-formats '("%Y-%m-%d" . "%Y-%m-%d %H:%M"))
(make-backup-files nil)
(auto-save-default nil)
(esy-publish--buffers nil)
+ (esy-publish--publishing t)
(initial-buffers (buffer-list))
(org-publish-project-alist
(list '("all" :components ("assets" "org"))
(time ((class . "copyright-year")) "2023")
" %a"))))))))
(org-publish "all" force)
- (dolist (buffer (seq-difference esy-publish--buffers
- initial-buffers))
+ (dolist (buffer (seq-uniq
+ (seq-difference esy-publish--buffers
+ initial-buffers)))
(when (buffer-live-p buffer)
(with-current-buffer buffer
(set-buffer-modified-p nil))