Config: fix ox-hugo path
This commit is contained in:
@@ -8,7 +8,13 @@
|
||||
'(ace-window benchmark-init cape cnfonts corfu crux drag-stuff eglot embark-consult everything
|
||||
exec-path-form-shell gcmh hungry-delete marginalia multiple-cursors orderless
|
||||
restart-emacs smart-mode-line solarized-theme vertico))
|
||||
'(safe-local-variable-values '((org-use-tag-inheritance)))
|
||||
'(safe-local-variable-values
|
||||
'((eval progn
|
||||
(setq org-hugo-base-dir
|
||||
(if (eq system-type 'windows-nt) "h:/emacs/hugo/this-is-my-blog/"
|
||||
"~/org/hugo/this-is-my-blog/"))
|
||||
(org-hugo-auto-export-mode))
|
||||
(org-use-tag-inheritance)))
|
||||
'(warning-suppress-log-types '((initialization))))
|
||||
(custom-set-faces
|
||||
;; custom-set-faces was added by Custom.
|
||||
|
||||
1
init.el
1
init.el
@@ -18,6 +18,7 @@
|
||||
(require 'init-elpa)
|
||||
(require 'init-package)
|
||||
(require 'init-org)
|
||||
(require 'init-org-refile)
|
||||
(require 'init-completion)
|
||||
(require 'init-window)
|
||||
(require 'init-dired)
|
||||
|
||||
@@ -305,7 +305,7 @@ See `org-capture-templates' for more information."
|
||||
":END:"
|
||||
"\n\n") ;Place the cursor here finally
|
||||
"\n")))
|
||||
|
||||
(if *is-windows*
|
||||
(add-to-list 'org-capture-templates
|
||||
'("h" ;`org-capture' binding + h
|
||||
"Hugo post"
|
||||
@@ -314,13 +314,24 @@ See `org-capture-templates' for more information."
|
||||
;; and that it has a "Blog Ideas" heading. It can even be a
|
||||
;; symlink pointing to the actual location of all-posts.org!
|
||||
(file+headline "h:/emacs/hugo/this-is-my-blog/all-blog.org" "Blog Ideas")
|
||||
(function org-hugo-new-subtree-post-capture-template))))
|
||||
(function org-hugo-new-subtree-post-capture-template)))
|
||||
(add-to-list 'org-capture-templates
|
||||
'("h" ;`org-capture' binding + h
|
||||
"Hugo post"
|
||||
entry
|
||||
;; It is assumed that below file is present in `org-directory'
|
||||
;; and that it has a "Blog Ideas" heading. It can even be a
|
||||
;; symlink pointing to the actual location of all-posts.org!
|
||||
(file+headline "~/org/hugo/this-is-my-blog/all-blog.org" "Blog Ideas")
|
||||
(function org-hugo-new-subtree-post-capture-template)))))
|
||||
|
||||
;; 快速部署
|
||||
(defun my-blog-publish ()
|
||||
"Publish blog , git add/commit/push , generate commit message."
|
||||
(interactive)
|
||||
(let* ((blog-dir "h:/emacs/hugo/this-is-my-blog/")
|
||||
(let* ((blog-dir (if *is-windows*
|
||||
"h:/emacs/hugo/this-is-my-blog/"
|
||||
"~/org/hugo/this-is-my-blog/"))
|
||||
(timestamp (format-time-string "%Y-%m-%d %H:%M:%S"))
|
||||
(default-directory blog-dir))
|
||||
|
||||
@@ -349,7 +360,9 @@ See `org-capture-templates' for more information."
|
||||
"Save and preview blog."
|
||||
(interactive)
|
||||
(save-buffer)
|
||||
(let ((default-directory "h:/emacs/hugo/this-is-my-blog/"))
|
||||
(let ((default-directory (if *is-windows*
|
||||
"h:/emacs/hugo/this-is-my-blog/"
|
||||
"~/org/hugo/this-is-my-blog/")))
|
||||
;; 启动 Hugo server
|
||||
(start-process "hugo-server" "*hugo-server*"
|
||||
"hugo" "server" "-D" "--bind" "0.0.0.0" "--port" "1313")
|
||||
|
||||
Reference in New Issue
Block a user