diff options
Diffstat (limited to 'ennu.el')
-rw-r--r-- | ennu.el | 17 |
1 files changed, 6 insertions, 11 deletions
@@ -75,7 +75,6 @@ last form in BODY." tongue (file-name-extension filename))))) -(defun ennu-publish-index (filename-prefix tongue title subtitle posts-per-page posts) (defun ennu-index-filename (filename-prefix tongue &optional extension page-number) (let ((extension (if extension (concat "." extension) ""))) (ennu-add-tongue-suffix @@ -84,6 +83,7 @@ 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)) (page-numbers (number-sequence 1 number-of-pages))) `(,posts @@ -94,11 +94,9 @@ last form in BODY." (seq-mapn (lambda (posts page-number output-file) (with-temp-buffer - (insert (format "#+TITLE: %s\n" title subtitle)) + (insert (format "#+TITLE: %s\n" title)) (insert (format "#+LANGUAGE: %s\n" tongue)) (insert "#+OPTIONS: num:nil toc:nil\n\n") - (when subtitle - (insert (format "%s\n\n" subtitle))) (seq-do (lambda (post) (let ((metadata (ennu-post-metadata post))) (insert (format "* [[post:%s]]\n" (file-name-base post))) @@ -141,7 +139,7 @@ last form in BODY." (defun ennu--atom-date (date) (format-time-string "%Y-%m-%dT%H:%M:%SZ" date)) -(defun ennu-publish-feed (feed-file title subtitle rights posts) +(defun ennu-publish-feed (feed-file title rights posts) `(,posts (,feed-file) ,(lambda (output-file) @@ -157,8 +155,6 @@ last form in BODY." ,(format "Emacs %d.%d Org-mode %s ennu %s" emacs-major-version emacs-minor-version (org-version) ennu-version)) (rights ,rights) - ,@(when subtitle - `((subtitle ,subtitle))) ,@(seq-map 'ennu--feed-entry posts)))))))) (defun ennu--feed-entry (post) @@ -210,7 +206,7 @@ last form in BODY." :working-directory) (or (plist-get ennu-blog property) (user-error "Property %s not defined" property))) - ((or :blog-subtitle :pages-directory :unattached-static-files) + ((or :pages-directory :unattached-static-files) (plist-get ennu-blog property)) (_ (error "Unknown property %s" property)))) @@ -373,7 +369,6 @@ value of the last form in BODY." (interactive) (let ((make-backup-files nil) (blog-title (ennu-setting :blog-title)) - (blog-subtitle (ennu-setting :blog-subtitle)) (posts-per-page (ennu-setting :index-posts-per-page))) (ennu-with-current-directory (ennu-setting :working-directory) (ennu-with-temporary-directory temporary-directory @@ -388,14 +383,14 @@ value of the last form in BODY." (seq-map 'ennu-publish-post posts) ;; Publish feed (list (ennu-publish-feed (ennu-setting :atom-feed-file) - blog-title blog-subtitle + blog-title (ennu-setting :blog-license) (seq-take posts (ennu-setting :atom-feed-number-of-posts)))) ;; Publish indices (seq-map (lambda (tongue) (ennu-publish-index - "index" tongue blog-title blog-subtitle posts-per-page + "index" tongue blog-title posts-per-page (seq-filter (lambda (post) (string= tongue (ennu-post-tongue post))) posts))) |