changeset 588: |
0552341ac196 |
parent: |
7efdeaebaf22
|
child: |
74a55d5decce |
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Mon, 12 Aug 2024 18:32:35 -0400 |
permissions: |
-rw-r--r-- |
description: |
refactor org-id stuff to ulang, pkgbuild notes |
1 ;;; publish.el --- the.compiler.company publishing script -*- lexical-binding:t -*- 3 ;; emacsclient -e '(load-file "publish.el")' '(publish)' 10 (defvar project-dir "~/comp/org") 11 (defvar publish-dir "/tmp/www") 12 (defvar html-theme nil) 13 (defvar url "https://compiler.company") 14 (defvar vc-url "https://vc.compiler.company") 15 (defvar packy-url "https://packy.compiler.company") 16 (defvar html-nav (format "<div class=\"nav\" id=\"nav\"><h2 id=\"index\">*</h2><div id=\"text-index\"> (<a href = \"%s\">~</a><br> (<a href = \"%s/blog\">blog</a> <a href = \"%s/docs\">docs</a> <a href = \"%s/plan\">plan</a> <a href = \"%s/notes\">notes</a>)<br> (<a href = \"%s\">vc</a> <a href = \"%s\">packy</a>))</div></div>" 17 url url url url url vc-url packy-url)) 19 (defvar html-foot "<footer><p>updated %C</p></footer>") 21 ;; (setq org-protocol-project-alist 24 ;; :working-directory project-dir 25 ;; :online-suffix ".html" 26 ;; :working-suffix ".org"))) 28 (setq org-html-style-default "" 30 org-html-htmlize-output-type 'css 31 org-export-htmlize-output-type 'css 32 org-export-allow-bind-keywords t 33 org-html-doctype "html5" 34 org-html-html5-fancy t 35 org-html-validation-link nil 36 org-src-fontify-natively t 39 org-id-link-to-org-use-id t) 41 (setq org-publish-project-alist 42 `(("compiler.company" :components ("index" "meta" "blog" "docs" "notes" "plan")) 44 :base-directory ,project-dir 49 :html-doctype "<!doctype html>" 50 ;; :html-preamble ,html-nav 51 :html-postamble ,html-foot 52 :publishing-directory ,publish-dir 53 :publishing-function org-html-publish-to-html) 55 :base-directory ,(expand-file-name "meta" project-dir) 59 :html-doctype "<!doctype html>" 60 :publishing-directory ,(expand-file-name "meta" publish-dir) 61 :publishing-function org-html-publish-to-html 63 :html-preamble ,html-nav 64 :html-postamble ,html-foot) 66 :base-directory ,(expand-file-name "blog" project-dir) 70 :html-doctype "<!doctype html>" 71 :publishing-directory ,(expand-file-name "blog" publish-dir) 72 :publishing-function org-html-publish-to-html 74 :html-preamble ,html-nav 75 :html-postamble ,html-foot) 77 :base-directory ,(expand-file-name "plan" project-dir) 81 :html-doctype "<!doctype html>" 82 :publishing-directory ,(expand-file-name "plan" publish-dir) 83 :publishing-function org-html-publish-to-html 85 :html-preamble ,html-nav 86 :html-postamble ,html-foot) 88 :base-directory ,(expand-file-name "notes" project-dir) 92 :html-doctype "<!doctype html>" 93 :publishing-directory ,(expand-file-name "notes" publish-dir) 94 :publishing-function org-html-publish-to-html 96 :html-preamble ,html-nav 97 :html-postamble ,html-foot) 99 :base-directory ,(expand-file-name "docs" project-dir) 100 :base-extension "org" 102 :footnote-section-p t 103 :html-doctype "<!doctype html>" 104 :publishing-directory ,(expand-file-name "docs" publish-dir) 105 :publishing-function org-html-publish-to-html 107 :html-preamble ,html-nav 108 :html-postamble ,html-foot))) 111 (defun publish (&optional sitemap static force async) 112 "publish `rwest-io' content. 113 If STATIC is t, also publish media and static files. 114 If FORCE is t, skip checking file mod date and just publish all files. 115 If ASYNC is t, call `org-publish' asynchronously. 116 If given a prefix (C-u), set all args to t" 118 (if current-prefix-arg 122 (let ((default-directory project-dir)) 123 (message (format "publishing from %s" default-directory)) 124 (org-publish "compiler.company" force async)))