@ -1592,7 +1592,8 @@ and rewrite link paths to make blogging more seamless."
( mapconcat #' number-to-string
( mapconcat #' number-to-string
( org-export-get-headline-number destination info )
( org-export-get-headline-number destination info )
" . " ) )
" . " ) )
( t title ) )
( t
title ) )
;; Reference
;; Reference
( or ( org-element-property :CUSTOM_ID destination )
( or ( org-element-property :CUSTOM_ID destination )
( org-hugo-slug title )
( org-hugo-slug title )
@ -1605,15 +1606,19 @@ and rewrite link paths to make blogging more seamless."
destination info
destination info
nil #' org-html--has-caption-p ) ) )
nil #' org-html--has-caption-p ) ) )
( cond
( cond
( ( not number ) nil )
( ( not number )
( ( atom number ) ( number-to-string number ) )
nil )
( t ( mapconcat #' number-to-string number " . " ) ) ) ) ) ) )
( ( atom number )
( number-to-string number ) )
( t
( mapconcat #' number-to-string number " . " ) ) ) ) ) ) )
;; (message "[ox-hugo-link DBG] link description: %s" description)
;; (message "[ox-hugo-link DBG] link description: %s" description)
( when description
( when description
( format " [%s](#%s) "
( format " [%s](#%s) "
description
description
( org-export-get-reference destination info ) ) ) ) ) ) ) )
( org-export-get-reference destination info ) ) ) ) ) ) ) )
( ( org-export-inline-image-p link org-html-inline-image-rules )
( ( org-export-inline-image-p link org-html-inline-image-rules )
;; (message "[ox-hugo-link DBG] Inline image: %s" raw-path)
;; (message "[org-hugo-link DBG] processing an image: %s" contents)
;; (message "[org-hugo-link DBG] processing an image: %s" contents)
( let* ( ( path ( org-hugo--attachment-rewrite-maybe raw-path info ) )
( let* ( ( path ( org-hugo--attachment-rewrite-maybe raw-path info ) )
( parent ( org-export-get-parent link ) )
( parent ( org-export-get-parent link ) )
@ -1703,13 +1708,23 @@ and rewrite link paths to make blogging more seamless."
( link-param-str ( org-string-nw-p ( org-trim link-param-str ) ) ) )
( link-param-str ( org-string-nw-p ( org-trim link-param-str ) ) ) )
( if contents
( if contents
( progn
( progn
;; (message "[ox-hugo DBG org-hugo-link: contents=%s path=%s" contents path)
;; (message "[ox-hugo-link DBG] contents=%s path=%s" contents path)
( if link-param-str
;; (message "[ox-hugo-link DBG] link-param-str=%s" link-param-str)
( format " <a href= \" %s \" %s>%s</a> "
( cond
( org-html-encode-plain-text path )
( ;; If `contents' is a `figure' shortcode but doesn't
link-param-str
;; already have the `link' parameter set.
( org-link-unescape contents ) )
( and ( string-match-p " \\ ` {{< \\ s-*figure \\ s-+ " contents )
( format " [%s](%s) " contents path ) ) )
( not ( string-match-p " \\ ` {{< \\ s-*figure \\ s-+.*link= " contents ) ) )
( replace-regexp-in-string " \\ s-*>}} \\ ' "
( format " link= \" %s \" \\ & " path )
contents ) )
( link-param-str
( format " <a href= \" %s \" %s>%s</a> "
( org-html-encode-plain-text path )
link-param-str
( org-link-unescape contents ) ) )
( t
( format " [%s](%s) " contents path ) ) ) )
( if link-param-str
( if link-param-str
( let ( ( path ( org-html-encode-plain-text path ) ) )
( let ( ( path ( org-html-encode-plain-text path ) ) )
( format " <a href= \" %s \" %s>%s</a> "
( format " <a href= \" %s \" %s>%s</a> "