Making Org Publish config neater
Previously I had a huge config file for
org-publish, most of it was just
repeateddeclaration. I didn't know Emacs Lisp so I just added more on
new projects but I've been trying to learn E-Lisp & made my config
This is how I generate my Project's webpages. All my projects are in
projects is a list of my projects name & this
iterates over it to add my projects to
(require 'cl-lib) (setq projects '("pavo" "orion" "grus" "cetus" "lyra" "lynx" "hydra" "pyxis" "indus" "perseus" "pictor" "ara" "crux" "leo")) (setq org-publish-project-alist (append org-publish-project-alist (cl-loop for project in projects collect (list project :base-directory (concat "~/projects/" project) :base-extension "org" :publishing-directory (concat "~/public_html/" (car projects)) :publishing-function (quote org-html-publish-to-html)))))
So I used to copy-paste the same thing for all my projects earlier.
#emacs@freenode is very helpful.
That piece of code was producing unexpected results. I had
projects) in there which meant that all my projects were being exported
to the first project name in list which was pavo.
:publishing-directory (concat "~/public_html/" (car projects))
Replacing that line with this fixed it:
:publishing-directory (concat "~/public_html/" project)
cl was depreciated, I replaced it with
cl-lib. I just had to change
cl-loop & it worked fine.