From fc9fb1e406c4f9b75e074a9fbc34bd0e526448d4 Mon Sep 17 00:00:00 2001 From: Frederik Vanrenterghem Date: Thu, 30 Nov 2023 07:37:49 +0800 Subject: [PATCH 1/1] Initiele opmaak blog posts. --- html/navbar.html | 2 +- maak-website.el | 52 +++++++++++++++++++++++++++++++++++++++++++----- source/index.org | 4 ++-- 3 files changed, 50 insertions(+), 8 deletions(-) diff --git a/html/navbar.html b/html/navbar.html index e44fd94..787a91f 100644 --- a/html/navbar.html +++ b/html/navbar.html @@ -6,7 +6,7 @@ + Blog diff --git a/maak-website.el b/maak-website.el index 4d37c18..1bb4897 100644 --- a/maak-website.el +++ b/maak-website.el @@ -5,12 +5,33 @@ (content "main" "content") (postamble "footer" "postamble")) org-html-container-element "section") +(setq org-html-head-include-default-style nil) +;(setq org-html-htmlize-output-type 'css) ; default: 'inline-css (defun website-header (info) (with-temp-buffer (insert-file-contents "~/websites/stage.vanrenterghem.biz/html/navbar.html") (buffer-string))) +(defun post-header (exp-plist) + (with-temp-buffer + (insert (format "" + (or (org-export-data (plist-get exp-plist ':title) exp-plist) + "none"))) + (goto-char (point-min)) + (insert-file-contents "~/websites/stage.vanrenterghem.biz/html/post-header.html") + ;(goto-char (point-max)) + ;(insert (format "

Tags: %s

" + ; (or (org-export-data (plist-get exp-plist :filetags) exp-plist) + ; "none"))) + (buffer-string))) + (defun website-footer (info) (with-temp-buffer (insert-file-contents "~/websites/stage.vanrenterghem.biz/html/footer.html") @@ -31,23 +52,44 @@ PROJECT is the current project." (t entry))) (setq org-publish-project-alist - '(("orgfiles" + '(("pages" :base-directory "~/websites/stage.vanrenterghem.biz/source/" :base-extension "org" :publishing-directory "~/websites/stage.vanrenterghem.biz/target" :publishing-function org-html-publish-to-html - :exclude "assets*" ;; regexp :headline-levels 3 :section-numbers nil :with-toc nil :html-head-include-default-style nil :html-head "" :html-preamble t + :html-preamble website-header + :html-postamble website-footer + ) + + ("posts" + :base-directory "~/websites/stage.vanrenterghem.biz/source/posts/" + :base-extension "org" + :publishing-directory "~/websites/stage.vanrenterghem.biz/target" + :publishing-function org-html-publish-to-html + :exclude "assets*\\|sitemap.org\\|index.org" ;; regexp + :html-content-class "container content inlinepage card h-entry" + :headline-levels 3 + :section-numbers nil + :with-toc nil + :with-title nil + :html-head-include-default-style nil + :html-head "\n + " + :html-preamble t + :html-divs ((preamble "header" "preamble") + (content "article" "inlinepage card h-entry") + (postamble "footer" "postamble")) :recursive t :auto-sitemap t - ;:sitemap-filename "~/websites/stage.vanrenterghem.biz/source/posts/sitemap.org" - :html-preamble website-header + :html-preamble post-header :html-postamble website-footer + :sitemap-sort-folders ignore-errors :sitemap-format-entry my-org-publish-sitemap-default-entry :sitemap-sort-files anti-chronologically ) @@ -59,4 +101,4 @@ PROJECT is the current project." :publishing-directory "~/websites/stage.vanrenterghem.biz/target/assets/" :publishing-function org-publish-attachment) - ("website" :components ("orgfiles" "assets")))) + ("website" :components ("posts" "pages" "assets")))) diff --git a/source/index.org b/source/index.org index bca5833..b7a8bcb 100644 --- a/source/index.org +++ b/source/index.org @@ -16,11 +16,11 @@ Life occassionally takes me places, mostly close to home but regularly a bit fur I host [[http://git.vanrenterghem.biz][my own git server]], containing code samples that might be useful as a reference to some. This site's source is stored in there as well. -I [[./posts/index.html][blog]] irregularly about free software, R stats (mostly data visualisation) and occassionaly even about economics or politics. +I [[file:sitemap.org][blog]] irregularly about free software, R stats (mostly data visualisation) and occassionaly even about economics or politics. ** Latest posts -#+INCLUDE: "sitemap.org" :lines "5-14" +#+INCLUDE: "sitemap.org" :lines "4-14" #+BEGIN_EXPORT html -- 2.39.5