]> git.vanrenterghem.biz Git - www2.vanrenterghem.biz.git/blobdiff - maak-website.el
Toon datum in bestandenlijst.
[www2.vanrenterghem.biz.git] / maak-website.el
index e0c8c065da961a9b82b7e70d050e6a7889ac3077..4d37c188c7f7fe6af6a6a078274eb5d91c06ef91 100644 (file)
@@ -1,6 +1,10 @@
 (require 'ox-publish)
 
 (setq org-html-doctype "html5")
+(setq org-html-divs '((preamble "header" "top")
+                        (content "main" "content")
+                        (postamble "footer" "postamble"))
+      org-html-container-element "section")
 
 (defun website-header (info)
   (with-temp-buffer
     (insert-file-contents "~/websites/stage.vanrenterghem.biz/html/footer.html")
     (buffer-string)))
 
+(defun my-org-publish-sitemap-default-entry (entry style project)
+  "My format for site map ENTRY, as a string.
+ENTRY is a file name.  STYLE is the style of the sitemap.
+PROJECT is the current project."
+  (cond ((not (directory-name-p entry))
+        (format "%s - [[file:%s][%s]]" ;;the date and filename are added after the entry
+                (format-time-string "%e %b %Y" (org-publish-find-date entry project))
+                entry
+                (org-publish-find-title entry project)))
+       ((eq style 'tree)
+        ;; Return only last subdir.
+        (file-name-nondirectory (directory-file-name entry)))
+       (t entry)))
+
 (setq org-publish-project-alist
       '(("orgfiles"
          :base-directory "~/websites/stage.vanrenterghem.biz/source/"
          :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
         :recursive t
         :auto-sitemap t
+        ;:sitemap-filename "~/websites/stage.vanrenterghem.biz/source/posts/sitemap.org"
         :html-preamble website-header
         :html-postamble website-footer
+        :sitemap-format-entry my-org-publish-sitemap-default-entry
+        :sitemap-sort-files anti-chronologically
         )
 
         ("assets"