Update org-publish-project-alist

Move project directory finding into own function, used by
my/open-projects-directory and in org-publish-project-alist
This commit is contained in:
Evie Litherland-Smith 2024-05-04 10:06:38 +01:00
parent 08d2958816
commit 8f94ea5263

37
init.el
View file

@ -381,15 +381,21 @@
(keymap-global-set "C-c w d" #'my/open-documents-directory) (keymap-global-set "C-c w d" #'my/open-documents-directory)
(keymap-global-set "C-c w C-d" #'my/open-downloads-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 () (defun my/open-projects-directory ()
"Open Projects directory. "Open Projects directory.
Try `magit-clone-default-directory' if available, fall back to Uses `my/projects-directory' to find correct directory"
~/Projects otherwise."
(interactive) (interactive)
(require 'magit) (require 'magit)
(find-file (if magit-clone-default-directory (find-file (my/projects-directory)))
magit-clone-default-directory
"~/Projects/")))
(keymap-global-set "C-c w p" #'my/open-projects-directory) (keymap-global-set "C-c w p" #'my/open-projects-directory)
(use-package calendar (use-package calendar
@ -847,32 +853,19 @@ Try `magit-clone-default-directory' if available, fall back to
(setq org-latex-compiler "lualatex") (setq org-latex-compiler "lualatex")
(setq org-preview-latex-default-process 'dvisvgm) (setq org-preview-latex-default-process 'dvisvgm)
(require 'tramp)
(setq org-publish-project-alist (setq org-publish-project-alist
'(("landing" `(("xenia.me.uk"
:base-directory "~/Documents/Web/landing/" :base-directory ,(expand-file-name "www/xenia.me.uk" (my/projects-directory))
:base-extension "org" :base-extension "org"
:exclude "README.org"
:recursive t :recursive t
:publishing-function org-html-publish-to-html :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 :section-numbers nil
:with-author t :with-author t
:with-email t :with-email t
:with-toc nil :with-toc nil
;; :html-head "<link rel=\"stylesheet\" type=\"text/css\" href=\"https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/readtheorg.css\"/>" ;; :html-head "<link rel=\"stylesheet\" type=\"text/css\" href=\"https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/readtheorg.css\"/>"
)
("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 "<link rel=\"stylesheet\" type=\"text/css\" href=\"https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/readtheorg.css\"/>"
))) )))
(use-package rainbow-delimiters (use-package rainbow-delimiters