From 2d02cb5655718ffa1737c7f4b87d7702d31affdb Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 2 Sep 2019 22:58:49 +0530 Subject: Publish video and poster, not just one. * ennu.el (ennu-publish-link): Publish video and poster, not just one of them. Return a list of operations instead of a single operation. (ennu-publish-post): Accept a list of operations from ennu-publish-link. --- ennu.el | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/ennu.el b/ennu.el index f8bab98..a8ac483 100644 --- a/ennu.el +++ b/ennu.el @@ -112,7 +112,7 @@ last form in BODY." ;; tangle-dir) ;; t))) (let ((link-publish-operations - (seq-map 'ennu-publish-link (seq-mapcat 'ennu-post-links posts))) + (seq-mapcat 'ennu-publish-link (seq-mapcat 'ennu-post-links posts))) (input-post-files (seq-map 'ennu-post-filename posts))) (cons (ennu-make-operation @@ -381,16 +381,19 @@ if DESTINATION already exists." (defun ennu-publish-link (link) (pcase link (`("image" . ,path) - (ennu-publish-image - (list (ennu-setting :default-image-width) - (ennu-setting :image-link-width)) - (ennu--expand-relative path (ennu-setting :images-directory)))) + (list + (ennu-publish-image + (list (ennu-setting :default-image-width) + (ennu-setting :image-link-width)) + (ennu--expand-relative path (ennu-setting :images-directory))))) (`("static" . ,path) - (ennu-publish-copy (ennu--expand-relative path (ennu-setting :static-directory)))) + (list + (ennu-publish-copy (ennu--expand-relative path (ennu-setting :static-directory))))) (`("video" . ,path) - (ennu-publish-copy (ennu--expand-relative path (ennu-setting :video-directory))) - (ennu-publish-copy (ennu--expand-relative (ennu-video-poster path) - (ennu-setting :images-directory)))))) + (list + (ennu-publish-copy (ennu--expand-relative path (ennu-setting :video-directory))) + (ennu-publish-copy (ennu--expand-relative (ennu-video-poster path) + (ennu-setting :images-directory))))))) (defmacro ennu-with-current-directory (directory &rest body) "Change to DIRECTORY, evaluate BODY and restore the current -- cgit v1.2.3