aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-08-17 00:21:24 +0530
committerArun Isaac2022-08-17 00:51:55 +0530
commit81cb2f254ad8b0e19088b51908d3469cec99fc3e (patch)
tree835891a54e3a102a79c6887d6170eb2e1a5b245c
parentb0d3fbacad614325191f045e0838f4ae0987dd25 (diff)
downloadennum-81cb2f254ad8b0e19088b51908d3469cec99fc3e.tar.gz
ennum-81cb2f254ad8b0e19088b51908d3469cec99fc3e.tar.lz
ennum-81cb2f254ad8b0e19088b51908d3469cec99fc3e.zip
Pass tongue argument to ennum-publish-index.
Pass tongue argument to ennum-publish-index and ennum-publish-index-page instead of letting them discover it themselves. * ennum.el (ennum-publish): Pass tongue argument to ennum-publish-index. (ennum-publish-index): Accept tongue argument. Pass tongue argument to ennum-publish-index-page. (ennum-publish-index-page): Accept tongue argument.
-rw-r--r--ennum.el18
1 files changed, 8 insertions, 10 deletions
diff --git a/ennum.el b/ennum.el
index 7e75dc5..c0556d2 100644
--- a/ennum.el
+++ b/ennum.el
@@ -422,11 +422,10 @@ result as a string."
(concat filename-prefix extension))
tongue)))
-(defun ennum-publish-index-page (filename-prefix title last-page posts page-number output-file)
+(defun ennum-publish-index-page (filename-prefix title last-page posts page-number tongue output-file)
(ennum-exp
- (let* ((tongue (ennum-post-language (first posts)))
- (system-time-locale
- (map-elt (ennum-setting :locale-alist) tongue)))
+ (let ((system-time-locale
+ (map-elt (ennum-setting :locale-alist) tongue)))
(when (file-name-directory output-file)
(ennum-mkdir-p (file-name-directory output-file)))
(with-temp-buffer
@@ -468,9 +467,8 @@ result as a string."
(ennum-index-filename filename-prefix tongue "html" 1))
(ennum-add-tongue-suffix (format "%s.html" filename-prefix) tongue))))
-(defun ennum-publish-index (filename-prefix title posts-per-page posts)
- (let* ((tongue (ennum-post-language (first posts)))
- (number-of-pages (ceiling (length posts) posts-per-page))
+(defun ennum-publish-index (filename-prefix title posts-per-page tongue posts)
+ (let* ((number-of-pages (ceiling (length posts) posts-per-page))
(page-numbers (number-sequence 1 number-of-pages))
(output-files (seq-map (apply-partially
'ennum-index-filename filename-prefix tongue "html")
@@ -479,7 +477,7 @@ result as a string."
(ennum-publish-index-page
filename-prefix title
(= page-number number-of-pages)
- post page-number output-file))
+ post page-number tongue output-file))
(seq-partition posts posts-per-page)
page-numbers
output-files)))
@@ -709,7 +707,7 @@ as keys. Keys are compared using `equal'."
;; Publish indices
(seq-mapcat
(pcase-lambda (`(,tongue . ,posts))
- (ennum-publish-index "index" blog-title posts-per-page posts))
+ (ennum-publish-index "index" blog-title posts-per-page tongue posts))
(seq-group-by 'ennum-post-language posts))
;; Publish tag indices
(seq-mapcat
@@ -718,7 +716,7 @@ as keys. Keys are compared using `equal'."
(pcase-lambda (`(,tongue . ,posts))
(ennum-publish-index
(ennum--file-join (ennum-setting :tag-directory) tag)
- tag posts-per-page posts))
+ tag posts-per-page tongue posts))
(seq-group-by 'ennum-post-language posts)))
(ennum-many-to-many-group-by 'ennum-post-tags posts))
;; Publish thumbnails