Skip to content

Commit

Permalink
Fix post subtree count not getting reset after file-based export
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushalmodi committed Jan 25, 2018
1 parent 1aa2536 commit ec94942
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ox-hugo.el
Original file line number Diff line number Diff line change
Expand Up @@ -2862,17 +2862,16 @@ approach)."
;; empty.
"EXPORT_FILE_NAME<>\"\""))
(if ret
(progn
(message "[ox-hugo] Exported %d subtree%s from %s"
org-hugo--subtree-count
(if (= 1 org-hugo--subtree-count) "" "s")
f-or-b-name)
(setq org-hugo--subtree-count nil)) ;Reset the variable
(message "[ox-hugo] Exported %d subtree%s from %s"
org-hugo--subtree-count
(if (= 1 org-hugo--subtree-count) "" "s")
f-or-b-name)
;; If `ret' is nil, no valid Hugo subtree was found.
;; So call `org-hugo-export-wim-to-md' directly. In
;; that function, it will be checked if the whole
;; Org file can be exported.
(setq ret (org-hugo-export-wim-to-md nil async visible-only noerror)))
(setq org-hugo--subtree-count nil) ;Reset the variable
ret)
;; Publish only the current subtree
(ignore-errors
Expand Down Expand Up @@ -2941,6 +2940,7 @@ approach)."
;; supposed to be exported as a whole, in which case
;; #+TITLE has to be defined *and* there shouldn't be
;; any valid Hugo post subtree present.
(setq org-hugo--subtree-count nil) ;Also reset the subtree count
(let ((valid-subtree-found
(catch 'break
(org-map-entries
Expand Down

0 comments on commit ec94942

Please sign in to comment.