diff options
author | Arun Isaac | 2019-08-27 13:25:34 +0530 |
---|---|---|
committer | Arun Isaac | 2019-08-27 13:25:34 +0530 |
commit | 819271eee5eb512309c3020da949b73016f26cd2 (patch) | |
tree | 32d97ba3717fdc998052b31cb5bc20533a6b7f9a /ennu.el | |
parent | f686c4fd2a2cae51c01f000d8b648cbbd3b1541a (diff) | |
download | ennum-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.
Diffstat (limited to 'ennu.el')
-rw-r--r-- | ennu.el | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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 |