aboutsummaryrefslogtreecommitdiff
path: root/ennum.el
diff options
context:
space:
mode:
authorArun Isaac2020-07-31 02:29:22 +0530
committerArun Isaac2020-07-31 03:05:09 +0530
commitcf2de46bdc76f895e51d5d247f544a473681c4a8 (patch)
tree6c80fc42874102cc4be911e7f3b979f9f0bca4fa /ennum.el
parentdec62cff5d4bc05589361a53d5939ff2f032f231 (diff)
downloadennum-cf2de46bdc76f895e51d5d247f544a473681c4a8.tar.gz
ennum-cf2de46bdc76f895e51d5d247f544a473681c4a8.tar.lz
ennum-cf2de46bdc76f895e51d5d247f544a473681c4a8.zip
Pass video posters through info.
* ennum.el (ennum-post): Add video-posters slot. (ennum--read-post): Set video-posters slot when creating post object. (ennum-publish-post, ennum--feed-entry): Pass video-posters in info communication channel. * ennum-html.el (ennum-html-link): Handle video links differently from normal org links since they require access to the info communication channel. Get poster from info instead of reading the source tree directly. (ennum-export-video): Delete function. (org-link-parameters): Unregister ennum-export-video.
Diffstat (limited to 'ennum.el')
-rw-r--r--ennum.el17
1 files changed, 12 insertions, 5 deletions
diff --git a/ennum.el b/ennum.el
index 481d262..bd5f3fe 100644
--- a/ennum.el
+++ b/ennum.el
@@ -15,7 +15,7 @@
(cl-defstruct (ennum-post (:constructor ennum-make-post)
(:copier nil))
filename slug author date language links tangle
- summary tags thumbnail title translation-group)
+ summary tags thumbnail title translation-group video-posters)
(cl-defstruct (ennum-operation (:constructor ennum-make-operation)
(:copier nil))
@@ -83,7 +83,12 @@
links))
:title (funcall export (first (plist-get metadata :title)))
:translation-group (or (plist-get metadata :translation-group)
- (file-name-base filename)))))))
+ (file-name-base filename))
+ :video-posters (ennum--filter-map (lambda (link)
+ (pcase link
+ (`("video" . ,path)
+ `(,path . ,(ennum-video-poster path)))))
+ links))))))
(defvar ennum-mandatory-metadata
(list :title :date))
@@ -119,7 +124,8 @@ last form in BODY."
(ennum-with-file-contents (ennum-post-filename post)
(org-export-to-file
'ennum-html output-file nil nil nil nil
- (list :ennum-translations (seq-remove (apply-partially 'equal post) posts))))))
+ (list :ennum-translations (seq-remove (apply-partially 'equal post) posts)
+ :ennum-video-posters (ennum-post-video-posters post))))))
posts
output-files))))
(ennum--filter-map
@@ -272,8 +278,9 @@ last form in BODY."
(name ,(ennum-post-author post))
(email ,user-mail-address))))
(content :type "html" :xml:lang ,(ennum-post-language post)
- ,(ennum-with-file-contents (ennum-post-filename post)
- (org-export-as 'ennum-html nil nil t)))
+ ,(ennum-with-file-contents interned-post-file
+ (org-export-as 'ennum-html nil nil t
+ (list :ennum-video-posters (ennum-post-video-posters post)))))
(link :rel "alternate" :href ,link)
,@(seq-map (lambda (tag) `(category :term ,tag))
(ennum-post-tags post)))))