让 hugo 能把 attach 方式导入的资源发布到 public

说明 重写 ox-hugo/ox-hugo.el 中的 org-hugo--attachment-rewrite-maybe 方法(大约在3189行) 1 2 3 4 5 6 7 ;;... (let* ((file-name-relative-path ;; ... ;; ... ((string-match (regexp-quote default-directory) path-true) (substring path-true (match-end 0))) ;; ... 把 (substring path-true (match-end 0)) (大约 3267 行) 修改为: 1 2 3 4 5 6 (let* ((attach-path (substring path-true (match-end 0))) ;; 如果 以 ~org-attach-directory~ 开头,通常是: ~xxxxx/.attach/xx/xxxxxx/xxxx. (rewrite-attach-path (if (string-match (regexp-quote (file-truename org-attach-directory)) path-true) (concat "attach/" (file-name-nondirectory attach-path)) attach-path))) ;;(message "[ox-hugo DBG attch rewrite BUNDLE 2] attch along with Org content: %s" rewrite-attach-path) rewrite-attach-path) 完整内容如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22...

2024-07-05 · 2 分钟 · 七二十洞天