aboutsummaryrefslogtreecommitdiff
path: root/publish.el
diff options
context:
space:
mode:
Diffstat (limited to 'publish.el')
-rw-r--r--publish.el55
1 files changed, 30 insertions, 25 deletions
diff --git a/publish.el b/publish.el
index e3aaa6f..8f101c6 100644
--- a/publish.el
+++ b/publish.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2021 Yuchen Pei.
+;; Copyright (C) 2021-2022 Yuchen Pei.
;; This file is part of site generator for Yuchen's personal website (abbreviated to sg4y).
@@ -26,10 +26,10 @@
(defun me/html-preamble (plist)
"PLIST: An entry."
(if (org-export-get-date plist this-date-format)
- (plist-put plist
- :subtitle (format "Published on %s"
- (org-export-get-date plist this-date-format)
- )))
+ (plist-put plist
+ :subtitle
+ (format "Published on %s"
+ (org-export-get-date plist this-date-format))))
;; Preamble
(with-temp-buffer
(insert-file-contents "../html-templates/preamble.html") (buffer-string)))
@@ -38,6 +38,12 @@
(with-temp-buffer
(insert-file-contents "../html-templates/postamble.html") (buffer-string)))
+(defun me/html-postamble-post (plist)
+ (concat "<div id=\"comments\">
+ <section id=\"isso-thread\"></section>
+</div>"
+ (me/html-postamble plist)))
+
(defun me/org-posts-sitemap-format-entry (entry style project)
"Format posts with author and published data in the index page.
@@ -49,8 +55,7 @@ PROJECT: `posts in this case."
(format-time-string this-date-format
(org-publish-find-date entry project))
entry
- (org-publish-find-title entry project)
- ))
+ (org-publish-find-title entry project)))
((eq style 'tree) (file-name-nondirectory (directory-file-name entry)))
(t entry)))
@@ -60,14 +65,14 @@ The content starts with the first empty line."
(let ((file (org-publish--expand-file-name file project)))
(when (and (file-readable-p file) (not (directory-name-p file)))
(with-temp-buffer
- (insert-file-contents file)
- ;; important, otherwise org may truncate the sitemap, probably
- ;; due to some problem in converting all things to a list
- (delete-trailing-whitespace)
- (goto-char (point-min))
- (let ((beg (+ 1 (re-search-forward "^$"))))
- (buffer-substring beg (point-max)))))))
-
+ (insert-file-contents file)
+ ;; important, otherwise org may truncate the sitemap, probably
+ ;; due to some problem in converting all things to a list
+ (delete-trailing-whitespace)
+ (goto-char (point-min))
+ (let ((beg (+ 1 (re-search-forward "^$"))))
+ (buffer-substring beg (point-max)))))))
+
(defun me/org-microposts-sitemap-format-entry (entry style project)
"Format microposts with author and published data in the index page.
@@ -75,16 +80,16 @@ ENTRY: file-name
STYLE:
PROJECT: `microposts in this case."
(cond ((not (directory-name-p entry))
- (format "*[[%s][%s]]* - %s\n<<%s>>\n\n%s"
- (file-name-sans-extension entry)
- (format-time-string this-date-format
- (org-publish-find-date entry project))
- (org-publish-find-title entry project)
- (file-name-sans-extension entry)
- (org-publish-find-content entry project)
- ))
- ((eq style 'tree) (file-name-nondirectory (directory-file-name entry)))
- (t entry)))
+ (format "*[[%s][%s]]* - %s\n<<%s>>\n\n%s"
+ (file-name-sans-extension entry)
+ (format-time-string this-date-format
+ (org-publish-find-date entry project))
+ (org-publish-find-title entry project)
+ (file-name-sans-extension entry)
+ (org-publish-find-content entry project)
+ ))
+ ((eq style 'tree) (file-name-nondirectory (directory-file-name entry)))
+ (t entry)))
(defun me/org-publish-microblog (plist filename pub-dir)
"Publish RSS with PLIST, only when FILENAME is '../pages/microblog.org'.