summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-03-29 01:05:38 +0100
committerjao <jao@gnu.org>2021-03-29 01:05:38 +0100
commit8d6b8bf4c7dadff8c69894f05fef40806fea659f (patch)
treed48e5133099224092fced7e787e8605360f2b02f
parent24eea5f2f540b837ab8f8d9330e446f68a167ecf (diff)
downloadelibs-8d6b8bf4c7dadff8c69894f05fef40806fea659f.tar.gz
elibs-8d6b8bf4c7dadff8c69894f05fef40806fea659f.tar.bz2
blog.org: preview markers handling
-rw-r--r--blog.org22
1 files changed, 18 insertions, 4 deletions
diff --git a/blog.org b/blog.org
index 83dd7ae..79a9dc8 100644
--- a/blog.org
+++ b/blog.org
@@ -103,9 +103,12 @@
(use-package org-static-blog
:ensure t
:init
- (setq org-static-blog-use-preview nil
+ (setq org-static-blog-use-preview t
org-static-blog-preview-link-p t
- org-static-blog-index-length 10
+ org-static-blog-preview-start "<!-- preview-start -->"
+ org-static-blog-preview-end "<!-- preview-end -->"
+ org-static-blog-preview-date-first-p t
+ org-static-blog-index-length 30
org-static-blog-preview-convert-titles t
org-static-blog-preview-ellipsis "more ..."
org-static-blog-enable-tags t
@@ -149,6 +152,12 @@
(geiser-default-implementation 'guile))
(org-static-blog-publish-file fname)))
+ (defconst jao-org-static-blog--prev-beg
+ "#+begin_export html\n <!-- preview-start -->\n#+end_export ")
+
+ (defconst jao-org-static-blog--prev-end
+ "#+begin_export html\n <!-- preview-end -->\n#+end_export ")
+
(defun jao-org-static-blog-next-sundry ()
(require 'rst)
(let* ((nos (mapcar (lambda (d)
@@ -175,9 +184,14 @@
"#+date: " (format-time-string "<%Y-%m-%d %H:%M>") "\n"
"#+filetags: ")
(cond ((string= "book" kind)
- (insert "books\n\n[[https://jao.io/img/" file ".jpg]]\n\n"))
+ (insert "books\n\n"
+ jao-org-static-blog--prev-beg
+ "\n\n[[https://jao.io/img/" file ".jpg]]\n\n"
+ jao-org-static-blog--prev-end
+ "\n"))
((string= "sundry" kind)
- (insert "sundry\n\nInteresting bits elsewhere:\n\n- "))
+ (insert "sundry\n\nInteresting bits elsewhere:\n\n- ")
+ (save-excursion (insert "\n\n\n" jao-org-static-blog--prev-end)))
(t (insert (completing-read "Tag: " jao-org-blog-tag-names)
"\n\n")))))
#+end_src