org+hugo: do ox-hugo stuff maybe
This commit is contained in:
parent
58a6acbb7f
commit
210d91fb58
@ -548,15 +548,16 @@ Return nil if DIR is not in a hugo project at all."
|
||||
(defun hugo-compile (dir)
|
||||
(let ((hugo-dir (hugo-dir-above dir)))
|
||||
(if hugo-dir
|
||||
(let* ((default-directory hugo-dir)
|
||||
(buffer (get-buffer-create "*hugo*")))
|
||||
(with-current-buffer buffer
|
||||
;; (pop-to-buffer buffer)
|
||||
(compilation-mode)
|
||||
(if (zerop (let ((inhibit-read-only t))
|
||||
(call-process "sh" nil buffer t "-c" "hugo")))
|
||||
(message "Hugo re-generated!")
|
||||
(error "Hugo Failed, better change something!")))))))
|
||||
(if (string-match-p default-directory "/content-org$")
|
||||
(org-hugo-export-wim-to-md-after-save)
|
||||
(let* ((default-directory hugo-dir)
|
||||
(buffer (get-buffer-create "*hugo*")))
|
||||
(with-current-buffer buffer
|
||||
(compilation-mode)
|
||||
(if (zerop (let ((inhibit-read-only t))
|
||||
(call-process "sh" nil buffer t "-c" "hugo")))
|
||||
(message "Hugo re-generated!")
|
||||
(error "Hugo Failed, better change something!"))))))))
|
||||
(add-hook 'after-save-hook
|
||||
(lambda () (hugo-compile default-directory))))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user