org-howto/bin/howto-publish
Roland Conybeare 5bd4ace9fe
All checks were successful
Deploy / publish (push) Successful in 21s
bugfix: base-extension in bin/howto-publish
need \\| for emacs regex
2026-06-21 21:05:16 -04:00

30 lines
986 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
src_dir="$(cd "$(dirname "$0")/.." && pwd)"
dest_dir="${1:?usage: howto-publish DEST_DIR}"
mkdir -p "${dest_dir}"
emacs --batch \
--eval "(package-activate-all)" \
--eval "(require 'ox-publish)" \
--eval "(setq org-html-htmlize-output-type 'css)" \
--eval "(setq org-publish-project-alist
'((\"org-howto\"
:components (\"org-howto-notes\" \"org-howto-static\"))
(\"org-howto-notes\"
:base-directory \"${src_dir}\"
:base-extension \"org\"
:publishing-directory \"${dest_dir}\"
:recursive t
:publishing-function org-html-publish-to-html
:auto-preamble t)
(\"org-howto-static\"
:base-directory \"${src_dir}\"
:base-extension \"css\\\\|html\\\\|js\\\\|svg\\\\|ico\\\\|png\\\\|jpg\\\\|gif\\\\|pdf\"
:publishing-directory \"${dest_dir}\"
:recursive t
:publishing-function org-publish-attachment)))" \
--eval "(org-publish \"org-howto\" t)"