diff options
Diffstat (limited to 'ennum-html.el')
-rw-r--r-- | ennum-html.el | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/ennum-html.el b/ennum-html.el index 65c0455..ac3f0c3 100644 --- a/ennum-html.el +++ b/ennum-html.el @@ -230,7 +230,7 @@ :datetime ,(org-export-get-date info "%Y-%m-%d 12:00:00") ,(org-export-get-date info "%B %d, %Y")))))))) ;; Interlanguage language links - (when-let (translations (plist-get info :ennum-translations)) + (when-let (translations (ennum-post-translations (plist-get info :ennum-post))) (format "<p>In other languages: %s</p>" (mapconcat (pcase-lambda (`(,lang . ,slug)) @@ -264,6 +264,14 @@ (org-html-footnote-section info) "</article>")) +(defun ennum-html-find-link (type path info) + "Find link of TYPE and PATH in post object stored in +:ennum-posts of property list INFO." + (seq-find (lambda (link) + (and (eq (ennum-link-type link) type) + (string= (ennum-link-path link) path))) + (ennum-post-links (plist-get info :ennum-post)))) + (defun ennum-html-link (link desc info) ;; We override the html link transcoder to handle image, post and ;; video links differently. We cannot use the `:export' property of @@ -296,8 +304,8 @@ ("post" (ennum-html-export-post path - (or desc (map-elt (plist-get info :ennum-post-titles) - path nil 'string=)) + (or desc (ennum-post-link-target-title + (ennum-html-find-link 'post path info))) (org-export-backend-name (plist-get info :back-end)))) ("video" (let ((video-directory (ennum-setting :video-directory))) @@ -305,9 +313,10 @@ (xmlgen `(video :src ,(url-encode-url (expand-file-name* path video-directory)) :poster ,(url-encode-url - (expand-file-name* (map-elt (plist-get info :ennum-video-posters) - path nil 'string=) - video-directory)) + (expand-file-name* + (ennum-video-link-poster + (ennum-html-find-link 'video path info)) + video-directory)) :preload "none" :controls "")))) ;; Pass other link types to org-html-link |