-
Notifications
You must be signed in to change notification settings - Fork 4
/
executable_org2blog
43 lines (35 loc) · 1.36 KB
/
executable_org2blog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env doomscript
(defcli! org2blog (orgfile)
(require 'doom-start)
(require 'org-roam)
(require 'citeproc-org-setup)
(citeproc-org-setup)
(setq max-lisp-eval-depth 9999999999)
(setq max-specpdl-size 5)
(toggle-debug-on-error)
(toggle-debug-on-quit)
(remove-hook! 'find-file-hook #'+org-roam-open-buffer-maybe-h)
(setq org-hugo-date-format "%Y-%m-%dT%T")
(defadvice! +editorconfig--inhibit-in-org-exports-a (orig-fn &rest args)
:around '(org-export-to-file org-babel-tangle)
(let ((editorconfig-exclude-regexps '(".")))
(apply orig-fn args)))
(with-temp-buffer
(insert-file-contents orgfile)
(if (save-excursion
(goto-char (point-min))
(search-forward "SETUPFILE" nil t))
(progn
(if (eq (save-excursion
(goto-char (point-min))
(search-forward "ISPRIVATE: t" nil t)) nil)
(progn
(print! (format "[build] exporting '%s'" orgfile))
(set-visited-file-name orgfile t)
(org-hugo-export-wim-to-md))
(progn
(print! (format "[build] skipping private file '%s'" orgfile)))))
(progn
(print! (format "[build] skipping file without SETUPFILE '%s'" orgfile)))))
(print! (format "[build] done processing '%s'" orgfile)))
(run! "org2blog" (cdr (member "--" argv)))