Config: fix ox-hugo path

This commit is contained in:
User
2026-04-09 18:07:51 +08:00
parent c3c59376f0
commit 8e9ba476f8
3 changed files with 33 additions and 13 deletions

View File

@@ -305,22 +305,33 @@ See `org-capture-templates' for more information."
":END:"
"\n\n") ;Place the cursor here finally
"\n")))
(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 "h:/emacs/hugo/this-is-my-blog/all-blog.org" "Blog Ideas")
(function org-hugo-new-subtree-post-capture-template))))
(if *is-windows*
(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 "h:/emacs/hugo/this-is-my-blog/all-blog.org" "Blog Ideas")
(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")