(require 'ox-publish) (require 'ox-html) ;; general settings (setq org-html-extension "xhtml") ;; custom URIs (org-link-set-parameters "xmpp") (org-link-set-parameters "monero") ;; html output customization (setq org-html-validation-link nil org-html-head-include-scripts nil org-html-head-include-default-style nil org-html-head "") ;; exclude sections for certain backends (defun wk/exclude-backends (backend) (setq org-export-exclude-tags `(,(concat "noexport_" (symbol-name backend)) "noexport"))) (add-hook 'org-export-before-parsing-functions #'wk/exclude-backends) ;; customize the html exporter (defun wk/org-html--tags (tags info) "Format TAGS into HTML. INFO is a plist containing export options." (when tags (format "%s" (mapconcat (lambda (tag) (if (string-prefix-p "noexport" tag) "" (format "%s" (concat (plist-get info :html-tag-class-prefix) (org-html-fix-class-name tag)) tag))) tags " ")))) (defun wk/org-html-format-headline-function (todo _todo-type priority text tags info) "Default format function for a headline. See `org-html-format-headline-function' for details and the description of TODO, PRIORITY, TEXT, TAGS, and INFO arguments." (let ((todo (org-html--todo todo info)) (priority (org-html--priority priority info)) (tags (wk/org-html--tags tags info))) (concat todo (and todo " ") priority (and priority " ") text (and tags "   ") tags))) (setq org-html-format-headline-function #'wk/org-html-format-headline-function) ;; project definition (setq org-publish-project-alist '(("http-content" :base-directory "./content/" :base-extension "org" :publishing-directory "./public/http" :recursive t :publishing-function org-html-publish-to-html :headline-levels 3 :with-author nil :with-creator nil :with-toc nil :section-numbers nil :time-stamp-file nil) ("http-assets" :base-directory "./content/assets" :base-extension any :exclude "\\.\\*.org" :publishing-directory "./public/http/assets" :recursive t :publishing-function org-publish-attachment))) ;; export all (org-publish-all t) (message "Build complete")