diff options
author | Arun Isaac | 2019-09-02 01:04:24 +0530 |
---|---|---|
committer | Arun Isaac | 2019-09-02 01:04:24 +0530 |
commit | 41980c4029edddea8bd97e091ec674f5a09f5db7 (patch) | |
tree | 74f65b3390d9e0e5ee99aa90aa3c7592c7b3b163 | |
parent | b11a04a4958f613d6159a0004addbeeadd516102 (diff) | |
download | ennum-41980c4029edddea8bd97e091ec674f5a09f5db7.tar.gz ennum-41980c4029edddea8bd97e091ec674f5a09f5db7.tar.lz ennum-41980c4029edddea8bd97e091ec674f5a09f5db7.zip |
Add slug slot to post structure.
* ennu.el (ennu-post): Add slug slot.
(ennu--read-post): Initialize slug slot.
(ennu-publish-index): Get slug slot instead of recomputing it.
-rw-r--r-- | ennu.el | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -14,7 +14,7 @@ (cl-defstruct (ennu-post (:constructor ennu-make-post) (:copier nil)) - filename author date language links + filename slug author date language links summary tags thumbnail title translation-group) (cl-defstruct (ennu-operation (:constructor ennu-make-operation) @@ -55,6 +55,7 @@ (cons link-type (org-element-property :path link)))))))))) (ennu-make-post :filename filename + :slug (file-name-base filename) :author (funcall export (first (plist-get metadata :author))) :date (org-timestamp-to-time (first (plist-get metadata :date))) :language (plist-get metadata :language) @@ -158,7 +159,7 @@ last form in BODY." (insert (format "#+LANGUAGE: %s\n" tongue)) (insert "#+OPTIONS: num:nil toc:nil\n\n") (seq-do (lambda (post) - (insert (format "* [[post:%s]]\n" (file-name-base (ennu-post-filename post)))) + (insert (format "* [[post:%s]]\n" (ennu-post-slug post))) (insert (format-time-string "/%b %e, %Y/\n\n" (ennu-post-date post))) |