Publishing Functions

Table of Contents

Publishing Functions

(defun wal-sh/publish ()
  "Publish files in the wal.sh project to the remote location."
  (interactive)
  (let ((org-publish-project-alist
         (mapcar (lambda (project)
                   (if (string-prefix-p "wal.sh" (car project))
                       (cons (car project)
                             (plist-put (cdr project) :publishing-directory
                                        (expand-file-name (file-name-nondirectory (plist-get (cdr project) :publishing-directory))
                                                          wal-sh/publishing)))
                     project))
                 org-publish-project-alist)))
    (org-publish "wal.sh")))

(defun wal-sh/publish-local ()
  "Publish files in the wal.sh project to the local directory."
  (interactive)
  (org-publish "wal.sh"))

(defun wal-sh/force-publish ()
  "Force republish all files in the wal.sh project to the remote location."
  (interactive)
  (let ((org-publish-use-timestamps-flag nil))
    (wal-sh/publish)))

(defun wal-sh/force-publish-local ()
  "Force publish files in the wal.sh project to the local directory."
  (interactive)
  (let ((org-publish-use-timestamps-flag nil))
    (wal-sh/publish-local)))

(global-set-key (kbd "C-c p") 'wal-sh/publish)
(global-set-key (kbd "C-c C-p") 'wal-sh/publish)
(global-set-key (kbd "C-c l") 'wal-sh/publish-local)
(global-set-key (kbd "C-c C-l") 'wal-sh/publish-local)

Author: Jason Walsh

jwalsh@nexus

Last Updated: 2025-07-30 13:45:27

build: 2025-12-23 09:13 | sha: e32f33e