Open protesilaos opened 11 months ago
Hi @protesilaos,
are you sure about the archive? The index should include full posts or previews, but the archive should only include headlines.
From: Bastian Bechtold @.***> Date: Sun, 10 Dec 2023 07:48:05 -0800
Hi @protesilaos,
are you sure about the archive? The index should include full posts or previews, but the archive should only include headlines.
Oh, sorry! I was meaning for the index. Can we have only headlines there?
-- Protesilaos Stavrou https://protesilaos.com
I see. If you'd like to contribute a mechanism for a headline-only index, I'd be happy to review it.
I have met the similar situation, my workaround is to cover the configuration outside the pulled repository.
(defun org-static-blog-get-preview (post-filename)
"Get title, date, tags from POST-FILENAME and get the first paragraph from the rendered HTML.
If the HTML body contains multiple paragraphs, include only the first paragraph,
and display an ellipsis.
Preamble and Postamble are excluded, too."
(with-temp-buffer
(insert-file-contents (org-static-blog-matching-publish-filename post-filename))
(let ((post-title (org-static-blog-get-title post-filename))
(post-date (org-static-blog-get-date post-filename))
(preview-region (org-static-blog--preview-region)))
;; Put the substrings together.
(let ((title-link
(format "<h2 class=\"post-title\"><a href=\"%s\">%s</a></h2>"
(org-static-blog-get-post-url post-filename) post-title))
(date-link
(format-time-string (concat "<div class=\"post-date\">"
(org-static-blog-gettext 'date-format)
"</div>")
post-date)))
(concat
title-link
preview-region
date-link
)))))
By doing so, only title, preview and date are displayed.
Hello @bastibe and thank you for this package!
I have noticed that when setting
org-static-blog-use-preview
to nil, the produced archive page includes the complete file contents. The code for that is inorg-static-blog-assemble-multipost-page
:Do you think we can make this behaviour configurable? The idea is to only display titles without any further contents.