(defun file-extension (filename) "returns the file extension of the supplied filename, or nil if no extension was present" (car (last (split-string filename "\\.")))) (defun org-html-publish-or-copy (plist filename pub-dir) "If the file extension is `.org`, publish using org-html-publish-to-html, otherwise use org-pubish-attachment." (if (string-equal (file-extension filename) "org") (org-html-publish-to-html plist filename pub-dir) (org-publish-attachment plist filename pub-dir))) (setq org-publish-use-timestamps-flag nil) (let ((root "~/Documents/orgsite/") (generated "generated/")) (setq org-publish-project-alist (nconc `(("fi" :base-directory ,(concat root "fi") :publishing-directory ,(concat root generated "fi") :base-extension any :exclude ".*~" :recursive t :publishing-function org-html-publish-or-copy :html-head-extra "" :html-postamble nil :html-preamble "
Siirry pääsisältöön FI · EN
" :with-toc nil :section-numbers nil :language "fi")) (seq-map (lambda (ident) `(,ident :base-directory ,(concat root ident) :publishing-directory ,(concat root generated ident) :base-extension any :publishing-function org-publish-attachment)) '("static" "img")))))