Skip to content

Commit 99ebb80

Browse files
committed
feat: custom denote blog export
1 parent 22f80f4 commit 99ebb80

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

README.org

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,6 @@ Emacs 启动过程的早期加载。
279279
(goto-char (point-max))
280280
(eval-print-last-sexp)))
281281
(load bootstrap-file nil 'nomessage))
282-
283-
(setq straight-vc-git-default-clone-depth 1)
284-
285282
#+end_src
286283

287284
** 空闲时增量加载包
@@ -2533,8 +2530,18 @@ ref:https://github.com/manateelazycat/toggle-one-window
25332530
(copy-file file blog-image-new-name)
25342531
(org-insert-link "" (concat "file:" blog-image-new-name) "")
25352532
))
2536-
)
2533+
(defun my-denote-blog-link-ol-export (link description format)
2534+
""
2535+
(let* ((denote-directory my-blogs-org-dir)
2536+
(path-id (denote-link--ol-resolve-link-to-target link :path-id))
2537+
(path (file-relative-name (car path-id))))
2538+
(format "[%s](%s)" description (concat my-hugo-post-url (file-name-sans-extension (downcase path))))))
25372539

2540+
(with-eval-after-load 'org
2541+
(org-link-set-parameters "denote" :export #'my-denote-blog-link-ol-export))
2542+
2543+
2544+
)
25382545
#+end_src
25392546

25402547
*** hugo 配置

0 commit comments

Comments
 (0)