aboutsummaryrefslogtreecommitdiff
path: root/makedocs.el
diff options
context:
space:
mode:
Diffstat (limited to 'makedocs.el')
-rw-r--r--makedocs.el35
1 files changed, 35 insertions, 0 deletions
diff --git a/makedocs.el b/makedocs.el
new file mode 100644
index 0000000..6675092
--- /dev/null
+++ b/makedocs.el
@@ -0,0 +1,35 @@
+(require 'ox-publish)
+
+;; 1. Define the project paths relative to this script
+(setq project-root (file-name-directory (or load-file-name buffer-file-name)))
+(setq org-notes-dir (expand-file-name "docs/" project-root))
+(setq public-dir (expand-file-name "public/" project-root))
+
+;; 2. Set up the publishing configuration
+(setq org-publish-project-alist
+ `(("project-docs"
+ :base-directory ,org-notes-dir
+ :base-extension "org"
+ :publishing-directory ,public-dir
+ :recursive t
+ :publishing-function org-html-publish-to-html
+ :headline-levels 4
+ :auto-preamble t
+ ;; This ensures ReadTheOrg works correctly
+ :html-head "<link rel=\"stylesheet\" type=\"text/css\" href=\"https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/readtheorg.css\"/>
+ <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js\"></script>
+ <script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js\"></script>
+ <script type=\"text/javascript\" src=\"https://fniessen.github.io/org-html-themes/src/readtheorg_theme/js/readtheorg.js\"></script>"
+ :html-head-extra "<link rel='stylesheet' type='text/css' href='https://gongzhitaao.org/orgcss/org.css'/>")
+ ("project-static"
+ :base-directory ,org-notes-dir
+ :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf"
+ :publishing-directory ,public-dir
+ :recursive t
+ :publishing-function org-publish-attachment)
+ ("all" :components ("project-docs" "project-static"))))
+
+;; 3. The magic command to build everything
+(org-publish-all t)
+
+(message "Build complete!")