summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2019-08-27 13:25:34 +0530
committerArun Isaac2019-08-27 13:25:34 +0530
commit819271eee5eb512309c3020da949b73016f26cd2 (patch)
tree32d97ba3717fdc998052b31cb5bc20533a6b7f9a
parentf686c4fd2a2cae51c01f000d8b648cbbd3b1541a (diff)
downloadennum-819271eee5eb512309c3020da949b73016f26cd2.tar.gz
ennum-819271eee5eb512309c3020da949b73016f26cd2.tar.lz
ennum-819271eee5eb512309c3020da949b73016f26cd2.zip
Infer index language from posts.
* ennu.el (ennu-publish-index): Infer language from posts. (ennu-publish): Do not pass language to ennu-publish-index.
-rw-r--r--ennu.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/ennu.el b/ennu.el
index 04017ba..a07a5b8 100644
--- a/ennu.el
+++ b/ennu.el
@@ -135,8 +135,9 @@ last form in BODY."
(concat filename-prefix extension))
tongue)))
-(defun ennu-publish-index (filename-prefix tongue title posts-per-page posts)
- (let* ((number-of-pages (ceiling (length posts) posts-per-page))
+(defun ennu-publish-index (filename-prefix title posts-per-page posts)
+ (let* ((tongue (ennu-post-language (first posts)))
+ (number-of-pages (ceiling (length posts) posts-per-page))
(page-numbers (number-sequence 1 number-of-pages)))
`(,(seq-map 'ennu-post-filename posts)
,(cons (ennu-add-tongue-suffix (format "%s.html" filename-prefix) tongue)
@@ -398,7 +399,7 @@ as keys. Keys are compared using `equal'."
;; Publish indices
(seq-map
(pcase-lambda (`(,tongue . ,posts))
- (ennu-publish-index "index" tongue blog-title posts-per-page posts))
+ (ennu-publish-index "index" blog-title posts-per-page posts))
(seq-group-by 'ennu-post-language posts))
(seq-mapcat
(pcase-lambda (`(,tag . ,posts))
@@ -406,7 +407,7 @@ as keys. Keys are compared using `equal'."
(pcase-lambda (`(,tongue . ,posts))
(ennu-publish-index
(ennu--expand-relative tag (ennu-setting :tag-directory))
- tongue tag posts-per-page posts))
+ tag posts-per-page posts))
(seq-group-by 'ennu-post-language posts)))
(ennu-many-to-many-group-by 'ennu-post-tags posts))
;; Publish links