Skip to content

Commit

Permalink
Move auto-update of org-id locations to the "wim" export function
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushalmodi committed Mar 15, 2022
1 parent d744fcd commit 63c87ee
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions ox-hugo.el
Expand Up @@ -4386,12 +4386,7 @@ links."

(destination (if (string= type "fuzzy")
(org-export-resolve-fuzzy-link link info)
(progn
;; Update `org-id-locations' if it's nil or empty hash table
;; to avoid broken link.
(when (or (eq org-id-locations nil) (zerop (hash-table-count org-id-locations)))
(org-id-update-id-locations (directory-files "." :full "\.org\$" :nosort)))
(org-export-resolve-id-link link (org-export--collect-tree-properties ast info)))))
(org-export-resolve-id-link link (org-export--collect-tree-properties ast info))))
(source-path (org-hugo--get-element-path link info))
(destination-path (org-hugo--get-element-path destination info))
(destination-type (org-element-type destination)))
Expand Down Expand Up @@ -4582,6 +4577,12 @@ The optional argument NOERROR is passed to
(buffer-name)))
(buf-has-subtree (org-hugo--buffer-has-valid-post-subtree-p))
ret)

;; Auto-update `org-id-locations' if it's nil or empty hash table
;; to avoid broken [[id:..]] type links.
(when (or (eq org-id-locations nil) (zerop (hash-table-count org-id-locations)))
(org-id-update-id-locations (directory-files "." :full "\.org\$" :nosort)))

(cond
;; Publish all subtrees in the current Org buffer.
((and buf-has-subtree all-subtrees)
Expand Down

0 comments on commit 63c87ee

Please sign in to comment.