From: Frederik Vanrenterghem Date: Thu, 28 Dec 2023 02:16:50 +0000 (+0800) Subject: Verbeter opmaak posts index pagina. X-Git-Url: http://git.vanrenterghem.biz/www2.vanrenterghem.biz.git/commitdiff_plain/057aedd288f248993bee6511d6c1d29a8415f5bf Verbeter opmaak posts index pagina. --- diff --git a/html/post-index.mustache b/html/post-index.mustache index 5622b6d..9a0923b 100644 --- a/html/post-index.mustache +++ b/html/post-index.mustache @@ -6,10 +6,23 @@ {{>navbar}} -
- - {{{contents}}} -
+
+
+
+ +
+
+
+ {{{contents}}} +
+
+
+
{{>footer}} diff --git a/html/post.mustache b/html/post.mustache index f4e2687..c8f4522 100644 --- a/html/post.mustache +++ b/html/post.mustache @@ -14,7 +14,7 @@
-
+
{{{contents}}}
diff --git a/maak-website.el b/maak-website.el index 25964b9..a30d8e2 100644 --- a/maak-website.el +++ b/maak-website.el @@ -9,6 +9,7 @@ (setq org-html-htmlize-output-type 'css) ; default: 'inline-css (setq org-time-stamp-custom-formats '("%A %e %B %Y" . "%A %e %B %Y at %H:%M")) (setq org-display-custom-times t) +(setq org-html-container-element "section") ;; TODO - check (setq my-blog-base-folder "~/websites/stage.vanrenterghem.biz") (setq my-blog-source-folder "~/websites/stage.vanrenterghem.biz/source") (setq my-blog-target-folder "~/websites/stage.vanrenterghem.biz/target") @@ -132,29 +133,38 @@ Either the section between #+BEGIN_PREVIEW and +#END_PREVIEW is used, or the fir (let* ((abspath (file-name-concat "/home/frederik/websites/stage.vanrenterghem.biz/source/posts" file)) (relpath (file-relative-name abspath "/home/frederik/websites/stage.vanrenterghem.biz/source/posts/")) (title (org-publish-find-title file project-plist)) - (date (format-time-string (cdr org-time-stamp-formats) (org-publish-find-date file project-plist))) + (date (format-time-string (cdr org-time-stamp-custom-formats) (org-publish-find-date file project-plist))) (preview (my-blog-get-preview abspath)) ) ;; insert a horizontal line before every post, kill the first one ;; before saving - (insert "-----\n") (insert (concat "* [[file:" relpath "][" title "]]\n")) ;; add properties for `ox-rss.el' here (let ((rss-permalink (concat (file-name-sans-extension relpath) ".html")) - (rss-pubdate date)) + (rss-pubdate (format-time-string (cdr org-time-stamp-formats) (org-publish-find-date file project-plist)))) (org-mode) + (org-set-property "HTML_CONTAINER_CLASS" "card mb-2") ;Bootstrap margin border 2 + (org-set-property "HTML_HEADLINE_CLASS" "card-header card-title border-bottom-0 fs-5 fw-bold text-decoration-none") (org-set-property "RSS_PERMALINK" rss-permalink) (org-set-property "PUBDATE" rss-pubdate) (org-set-property "RSS_TITLE" title)) ;; insert the date, preview, & read more link + (insert "#+ATTR_HTML: :class card-header\n") (insert (concat "Published: " date "\n\n")) + (insert "#+BEGIN_export html\n") + (insert "
\n") + (insert "#+END_export\n") (insert preview) ;(insert (concat "#+INCLUDE: \"" relpath "\" :only-contents t :lines \"1-10\"\n")) (insert "\n") - (insert (concat "[[file:" relpath "][Read More...]]\n")))) + (insert (concat "[[file:" relpath "][Read More...]]\n")) + (insert "#+BEGIN_export html\n") + (insert "<\/section>\n") + (insert "#+END_export\n") + )) ;; kill the first hrule to make this look OK - (goto-char (point-min)) - (let ((kill-whole-line t)) (kill-line)) + ;(goto-char (point-min)) + ;(let ((kill-whole-line t)) (kill-line)) ;; insert a title and save (insert "#+OPTIONS: title:nil\n") (insert "#+TITLE: Frederik Vanrenterghem's blog\n") @@ -185,11 +195,17 @@ representation for the files to include, as returned by (defun my-blog-cleanup-sitemaps (plist) "Clean up temporary files created in the process of publishing" + ;; Create a body-only version of the tags index. + (with-temp-file (file-name-concat + (plist-get (cdr (assoc "posts" org-publish-project-alist)) :publishing-directory) + "tag-index-body.html") + (insert-file-contents (file-name-concat + (plist-get (cdr (assoc "landing" org-publish-project-alist)) :base-directory) + "tag-index.org")) + (org-export-to-buffer 'mustache-html (current-buffer) nil nil nil t nil)) (delete-file (file-name-concat my-blog-source-folder "sitemap.org")) (delete-file (file-name-concat my-blog-posts-folder "sitemap.org")) - (delete-file (file-name-concat my-blog-posts-folder "sitemap.org~")) - - ) + (delete-file (file-name-concat my-blog-posts-folder "sitemap.org~"))) (setq org-publish-project-alist `(("landing"