From 8f94ea5263c949cf671d0a5d41651aba6042c7dc Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Sat, 4 May 2024 10:06:38 +0100 Subject: [PATCH] Update org-publish-project-alist Move project directory finding into own function, used by my/open-projects-directory and in org-publish-project-alist --- init.el | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/init.el b/init.el index ce91c13..f3870a9 100644 --- a/init.el +++ b/init.el @@ -381,15 +381,21 @@ (keymap-global-set "C-c w d" #'my/open-documents-directory) (keymap-global-set "C-c w C-d" #'my/open-downloads-directory) +(defun my/projects-directory () + "Return Projects directory. +If `magit-clone-default-directory' is available, return that, +otherwise fall back to ~/Projects/." + (require 'magit) + (if magit-clone-default-directory + magit-clone-default-directory + "~/Projects/")) + (defun my/open-projects-directory () "Open Projects directory. -Try `magit-clone-default-directory' if available, fall back to - ~/Projects otherwise." +Uses `my/projects-directory' to find correct directory" (interactive) (require 'magit) - (find-file (if magit-clone-default-directory - magit-clone-default-directory - "~/Projects/"))) + (find-file (my/projects-directory))) (keymap-global-set "C-c w p" #'my/open-projects-directory) (use-package calendar @@ -847,32 +853,19 @@ Try `magit-clone-default-directory' if available, fall back to (setq org-latex-compiler "lualatex") (setq org-preview-latex-default-process 'dvisvgm) +(require 'tramp) (setq org-publish-project-alist - '(("landing" - :base-directory "~/Documents/Web/landing/" + `(("xenia.me.uk" + :base-directory ,(expand-file-name "www/xenia.me.uk" (my/projects-directory)) :base-extension "org" - :exclude "README.org" :recursive t :publishing-function org-html-publish-to-html - :publishing-directory "/sshx:pixelifytica@legion:/var/www/landing" + :publishing-directory "/sshx:pixelifytica@legion:/var/www/xenia.me.uk" :section-numbers nil :with-author t :with-email t :with-toc nil ;; :html-head "" - ) - ("blog" - :base-directory "~/Documents/Web/blog/" - :base-extension "org" - :exclude "README.org" - :recursive t - :publishing-function org-html-publish-to-html - :publishing-directory "/sshx:pixelifytica@legion:/var/www/blog" - :section-numbers nil - :with-author t - :with-email t - :with-toc t - :html-head "" ))) (use-package rainbow-delimiters @@ -1045,7 +1038,7 @@ Try `magit-clone-default-directory' if available, fall back to (use-package python :hook ((python-base-mode . (lambda () (my/enable-fill-column 88))) (python-base-mode . (lambda () (add-hook 'flymake-diagnostic-functions - 'flymake-collection-mypy nil t)))) + 'flymake-collection-mypy nil t)))) :custom ;; Set max line length for compatibility with black formatter (python-flymake-command