Add title to blog index and don't add reading time to index

This commit is contained in:
Tom Willemse 2023-07-25 01:06:04 -07:00
parent 30a4eda7d3
commit 474f08e35a
2 changed files with 6 additions and 2 deletions

View file

@ -30,6 +30,7 @@ clean: ## Remove all of the build files
@rm -rvf *.elc
@rm -rvf public
@rm -rvf .org-timestamps
@rm -rvf posts/index.org
serve: ## Run a simple web server to look at the results
@cd public && php -S localhost:8000

View file

@ -58,9 +58,12 @@ Argument PROPS
."
(let ((files (directory-files "posts/" t (rx bos (= 8 digit) "-" (= 4 digit) "-" (one-or-more nonl) (not "~") eos))))
(with-temp-buffer
(insert "#+title: ryuslash's blog\n")
(insert "#+options: num:nil\n")
(insert "\n")
(apply 'insert
(mapcar (lambda (file)
(format "* %s\n:PROPERTIES:\n:CUSTOM_ID: %s\n:PUBDATE: %s\n:RSS_PERMALINK: %s\n:END:\n\n%s[[file:%s][Read More]]\n\n"
(format "* %s\n:PROPERTIES:\n:CUSTOM_ID: %s\n:PUBDATE: %s\n:RSS_PERMALINK: %s\n:END:\n\n%s\n\n[[file:%s][Read More]]\n\n"
(car (org-publish-find-property file :title props))
(file-name-nondirectory file)
(format-time-string "[%Y-%m-%d %a %H:%M]" (org-timestamp-to-time (car (org-publish-find-property file :date props))))
@ -115,7 +118,7 @@ Argument PROPS
:html-preamble (lambda (project)
(let ((buffer (find-file-noselect (buffer-file-name))))
(unless (member (car (org-publish-find-property (buffer-file-name) :title project))
'("ryuslash.org" "posts"))
'("ryuslash.org" "ryuslash's blog"))
(publish-format-reading-time
(publish-calculate-reading-time buffer))))))
("rss"