]> git.vanrenterghem.biz Git - www2.vanrenterghem.biz.git/blobdiff - maak-website.el
Initiele opmaak blog posts.
[www2.vanrenterghem.biz.git] / maak-website.el
index 4d37c188c7f7fe6af6a6a078274eb5d91c06ef91..1bb4897df7156725ce6da9d3cd00b151f34b85b8 100644 (file)
@@ -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 "<nav aria-label=\"breadcrumb\">
+              <ol class=\"breadcrumb\">
+               <li class=\"breadcrumb-item\"><a href=\"/\">Home</a></li>
+               <li class=\"breadcrumb-item\"><a href=\"/sitemap.html\">Blog</a></li>
+               <li class=\"breadcrumb-item active\" aria-current=\"page\">%s</li>
+              </ol>
+            </nav>"
+           (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 "<p>Tags: %s</p>"
+       ;           (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 "<link href=\"/assets/styles/bootstrap-5.3.0/css/bootstrap.min.css\" rel=\"stylesheet\" />"
          :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 "<link href=\"/assets/styles/bootstrap-5.3.0/css/bootstrap.min.css\" rel=\"stylesheet\" />\n
+        <link href=\"/assets/styles/org-htmlize.css\" rel=\"stylesheet\" />"
+         :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"))))