Skip to content

Commit

Permalink
Merge pull request #690 from tendant/customize-headline-anchor
Browse files Browse the repository at this point in the history
Add customization variable for headline anchor
  • Loading branch information
kaushalmodi authored Feb 12, 2025
2 parents 3515ee0 + 3d27dc7 commit 326c075
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ox-hugo.el
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,12 @@ https://github.com/kaushalmodi/ox-hugo/discussions/485."
:type 'boolean)
;;;###autoload (put 'org-hugo-goldmark 'safe-local-variable 'booleanp)

(defcustom org-hugo-headline-anchor t
"Enable anchor for headline"
:group 'org-export-hugo
:type 'boolean)
;;;###autoload (put 'org-hugo-headline-anchor 'safe-local-variable 'booleanp)

(defcustom org-hugo-section "posts"
"Default section for Hugo posts.

Expand Down Expand Up @@ -2143,7 +2149,8 @@ a communication channel."
bullet " " heading tags-fmtd "\n\n"
(and contents (replace-regexp-in-string "^" " " contents)))))
(t
(let* ((anchor (format "{#%s}" (org-hugo--get-anchor heading info))) ;https://gohugo.io/extras/crossreferences/
(let* ((anchor (when org-hugo-headline-anchor
(format "{#%s}" (org-hugo--get-anchor heading info)))) ;https://gohugo.io/extras/crossreferences/
(heading-title (org-hugo--heading-title style level loffset title
todo-fmtd tags-fmtd anchor numbers))
(wrap-element (org-hugo--container heading info))
Expand Down

0 comments on commit 326c075

Please sign in to comment.