re-enable ox-hugo

This commit is contained in:
MitchMarq42 2023-05-04 21:06:18 -08:00
parent bdbe81dc1e
commit 8db4f9eedd

View File

@ -625,40 +625,40 @@ targets."
:states 'normal :states 'normal
:keymaps 'org-src-mode-map :keymaps 'org-src-mode-map
"ZZ" 'org-edit-src-exit)) "ZZ" 'org-edit-src-exit))
;; (use-package ox-hugo (use-package ox-hugo
;; :after org :after org
;; :config :config
;; (defun hugo-dir-above (dir) (defun hugo-dir-above (dir)
;; "Return path of Hugo project root above or at DIR. "Return path of Hugo project root above or at DIR.
;; Return nil if DIR is not in a hugo project at all." Return nil if DIR is not in a hugo project at all."
;; (let ((thisdir dir)) (let ((thisdir dir))
;; (let ((lexical-binding t)) (let ((lexical-binding t))
;; (if (eq thisdir nil) nil (if (eq thisdir nil) nil
;; (if (file-exists-p (expand-file-name "config.toml" thisdir)) (if (file-exists-p (expand-file-name "config.toml" thisdir))
;; thisdir thisdir
;; (let ((updir (file-name-directory (string-trim-right thisdir "/")))) (let ((updir (file-name-directory (string-trim-right thisdir "/"))))
;; (hugo-dir-above updir))))))) (hugo-dir-above updir)))))))
;; ;; (hugo-dir-above "~/.local/git/mitchmarq42.github.io/content-org/") ;; (hugo-dir-above "~/.local/git/mitchmarq42.github.io/content-org/")
;; (defun hugo-compile (&optional dir) (defun hugo-compile (&optional dir)
;; (interactive) (interactive)
;; (if (bound-and-true-p dir) nil (if (bound-and-true-p dir) nil
;; (setq dir default-directory)) (setq dir default-directory))
;; (let ((hugo-dir (hugo-dir-above dir))) (let ((hugo-dir (hugo-dir-above dir)))
;; (if hugo-dir (if hugo-dir
;; (progn (progn
;; (if (string-match-p (rx bol (* any) "/content-org" (opt "/") eol) (if (string-match-p (rx bol (* any) "/content-org" (opt "/") eol)
;; default-directory) default-directory)
;; (org-hugo-export-wim-to-md)) (org-hugo-export-wim-to-md))
;; (let* ((default-directory hugo-dir) (let* ((default-directory hugo-dir)
;; (buffer (get-buffer-create "*hugo*"))) (buffer (get-buffer-create "*hugo*")))
;; (with-current-buffer buffer (with-current-buffer buffer
;; ;; (compilation-mode) ;; (compilation-mode)
;; (let* ((inhibit-read-only t) (let* ((inhibit-read-only t)
;; (status-code (call-process-shell-command "hugo" nil buffer))) (status-code (call-process-shell-command "hugo" nil buffer)))
;; (if (zerop status-code) (if (zerop status-code)
;; (message "Hugo re-generated!") (message "Hugo re-generated!")
;; (error "Hugo exited %s, better change something!" status-code))))))))) (error "Hugo exited %s, better change something!" status-code)))))))))
;; (add-hook 'after-save-hook #'hugo-compile)) (add-hook 'after-save-hook #'hugo-compile))
(use-package ox-clip (use-package ox-clip
:commands ox-clip-formatted-copy) :commands ox-clip-formatted-copy)