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

39
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 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 "<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
@ -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