aboutsummaryrefslogtreecommitdiff
path: root/ennum-html.el
diff options
context:
space:
mode:
authorArun Isaac2020-08-01 05:20:29 +0530
committerArun Isaac2020-08-01 20:15:52 +0530
commitd45b6e3aa3c1ffa0a37a4276dbd0e51ee44c32af (patch)
tree1e1cf417d45abeffa3bfe8bbf0a2e89f4a76cb28 /ennum-html.el
parent30e1efc4051a67e6e41561f45101c9077dc41e2e (diff)
downloadennum-d45b6e3aa3c1ffa0a37a4276dbd0e51ee44c32af.tar.gz
ennum-d45b6e3aa3c1ffa0a37a4276dbd0e51ee44c32af.tar.lz
ennum-d45b6e3aa3c1ffa0a37a4276dbd0e51ee44c32af.zip
Embed list of translations into post object.
* ennum.el (ennum-post): Add ennum-copy-post copier and translations slot. (ennum-posts): Set translations slot. (ennum-publish-post): Publish a single post, not a translation group of posts. (ennum-publish): Pass posts to ennum-publish-post one by one, without grouping. * ennum-html.el (ennum-html-inner-template): Use translations alist.
Diffstat (limited to 'ennum-html.el')
-rw-r--r--ennum-html.el18
1 files changed, 8 insertions, 10 deletions
diff --git a/ennum-html.el b/ennum-html.el
index f091789..bfad18f 100644
--- a/ennum-html.el
+++ b/ennum-html.el
@@ -233,16 +233,14 @@
(when-let (translations (plist-get info :ennum-translations))
(format "<p>In other languages: %s</p>"
(mapconcat
- (lambda (translation)
- (let ((lang (ennum-post-language translation))
- (slug (ennum-post-slug translation)))
- (replace-regexp-in-string
- "<a " (format "<a hreflang=\"%s\" " lang)
- (ennum-html-export-post
- slug
- (map-elt ennum-html--iso-639-1-alist lang nil 'string=)
- (org-export-backend-name
- (plist-get info :back-end))))))
+ (pcase-lambda (`(,lang . ,slug))
+ (replace-regexp-in-string
+ "<a " (format "<a hreflang=\"%s\" " lang)
+ (ennum-html-export-post
+ slug
+ (map-elt ennum-html--iso-639-1-alist lang nil 'string=)
+ (org-export-backend-name
+ (plist-get info :back-end)))))
translations
", ")))
;; Tags