diff options
author | Arun Isaac | 2019-09-02 01:31:31 +0530 |
---|---|---|
committer | Arun Isaac | 2019-09-02 01:31:31 +0530 |
commit | 1e1e485b082db622cea23fdaf33728a436ab8ccb (patch) | |
tree | f014de45f69d3d93329ef6db8a7f0b1cf1646709 /ennu.el | |
parent | 202a7ca2b2f33ee95b0ecf2bd6d01859f6930580 (diff) | |
download | ennum-1e1e485b082db622cea23fdaf33728a436ab8ccb.tar.gz ennum-1e1e485b082db622cea23fdaf33728a436ab8ccb.tar.lz ennum-1e1e485b082db622cea23fdaf33728a436ab8ccb.zip |
Publish links together with posts.
* ennu.el (ennu-publish-post): Publish links together with posts and
return a list of operations.
(ennu-publish): Concatenate the lists of operations returned from
ennu-publish-post. Do not invoke ennu-publish-link to publish links.
Diffstat (limited to 'ennu.el')
-rw-r--r-- | ennu.el | 42 |
1 files changed, 22 insertions, 20 deletions
@@ -100,20 +100,25 @@ last form in BODY." ;; (expand-file-name (file-name-nondirectory tangled-file) ;; tangle-dir) ;; t))) - (let ((input-post-files (seq-map 'ennu-post-filename posts))) - (ennu-make-operation - :inputs input-post-files - :outputs (seq-map 'ennu--org-output-filename input-post-files) - :publish - (lambda (&rest output-files) - (seq-mapn - (lambda (post output-file) - (ennu-with-file-contents (ennu-post-filename post) - (org-export-to-file - 'ennu-html output-file nil nil nil nil - (list :translations (seq-remove (apply-partially 'equal post) posts))))) - posts - output-files))))) + (let ((link-publish-operations + (seq-map 'ennu-publish-link (seq-mapcat 'ennu-post-links posts))) + (input-post-files (seq-map 'ennu-post-filename posts))) + (cons + (ennu-make-operation + :inputs (append input-post-files + (seq-mapcat 'ennu-operation-inputs link-publish-operations)) + :outputs (seq-map 'ennu--org-output-filename input-post-files) + :publish + (lambda (&rest output-files) + (seq-mapn + (lambda (post output-file) + (ennu-with-file-contents (ennu-post-filename post) + (org-export-to-file + 'ennu-html output-file nil nil nil nil + (list :translations (seq-remove (apply-partially 'equal post) posts))))) + posts + output-files))) + link-publish-operations))) (defun ennu-publish-page (pages-directory page) (ennu-make-operation @@ -417,9 +422,9 @@ as keys. Keys are compared using `equal'." (let ((posts (ennu-posts (ennu-setting :posts-directory)))) (append ;; Publish posts - (seq-map (pcase-lambda (`(,translation-group . ,posts)) - (ennu-publish-post posts)) - (seq-group-by 'ennu-post-translation-group posts)) + (seq-mapcat (pcase-lambda (`(,translation-group . ,posts)) + (ennu-publish-post posts)) + (seq-group-by 'ennu-post-translation-group posts)) ;; Publish feed (list (ennu-publish-feed (ennu-setting :atom-feed-file) blog-title @@ -439,9 +444,6 @@ as keys. Keys are compared using `equal'." tag posts-per-page posts)) (seq-group-by 'ennu-post-language posts))) (ennu-many-to-many-group-by 'ennu-post-tags posts)) - ;; Publish links - (seq-map 'ennu-publish-link - (seq-uniq (seq-mapcat 'ennu-post-links posts))) ;; Publish thumbnails (seq-map (apply-partially 'ennu-publish-image (list (ennu-setting :thumbnail-image-width))) |