summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJoel Kronqvist <joel.kronqvist@iki.fi>2026-06-12 00:15:21 +0300
committerJoel Kronqvist <joel.kronqvist@iki.fi>2026-06-12 00:15:21 +0300
commit60e06a26f4f35160528d22169ee314864c277db5 (patch)
treea62cfda95e27d81451ec7a20f09e0e66ef2fbcdd /lisp
downloadcron4.fi-60e06a26f4f35160528d22169ee314864c277db5.tar.gz
cron4.fi-60e06a26f4f35160528d22169ee314864c277db5.zip
created & configured finnish side of blog & imported two old blog posts
Diffstat (limited to 'lisp')
-rw-r--r--lisp/org-publish-project-alist.el44
-rw-r--r--lisp/org-publish-project-alist.el~33
2 files changed, 77 insertions, 0 deletions
diff --git a/lisp/org-publish-project-alist.el b/lisp/org-publish-project-alist.el
new file mode 100644
index 0000000..0310ce0
--- /dev/null
+++ b/lisp/org-publish-project-alist.el
@@ -0,0 +1,44 @@
+
+(defun file-extension (filename)
+ "returns the file extension of the supplied filename,
+or nil if no extension was present"
+ (car
+ (last
+ (split-string filename "\\."))))
+
+(defun org-html-publish-or-copy (plist filename pub-dir)
+ "If the file extension is `.org`, publish using
+org-html-publish-to-html, otherwise use org-pubish-attachment."
+ (if (string-equal (file-extension filename) "org")
+ (org-html-publish-to-html plist filename pub-dir)
+ (org-publish-attachment plist filename pub-dir)))
+
+(let ((root "~/Documents/orgsite/") (generated "generated/"))
+ (setq org-publish-project-alist
+ `(("blog"
+ :base-directory ,(concat root "blog")
+ :publishing-directory ,(concat root generated "blog")
+ :base-extension any
+ :exclude ".*~"
+ :publishing-function org-html-publish-or-copy
+ :html-head-extra "<link rel=\"stylesheet\"type=\"text/css\" href=\"../static/global.css\">"
+ :html-postamble nil
+ :with-toc nil
+ :section-numbers nil
+ :language "fi")
+
+
+ ; TODO Refactor
+ ("static"
+ :base-directory ,(concat root "static")
+ :publishing-directory ,(concat root generated "static")
+ :base-extension any
+ :publishing-function org-publish-attachment)
+ ("img"
+ :base-directory ,(concat root "img")
+ :publishing-directory ,(concat root generated "img")
+ :base-extension any
+ :publishing-function org-publish-attachment)
+
+
+ )))
diff --git a/lisp/org-publish-project-alist.el~ b/lisp/org-publish-project-alist.el~
new file mode 100644
index 0000000..70fb2ce
--- /dev/null
+++ b/lisp/org-publish-project-alist.el~
@@ -0,0 +1,33 @@
+(setq org-publish-project-alist
+ '(("fi"
+ :completion-function (lambda (a) (copy-file "~/Documents/orgsite/generated/fi/index.html" "~/Documents/orgsite/generated/index.html" 1))
+ :base-directory "~/Documents/orgsite/pages/fi"
+ :publishing-directory "~/Documents/orgsite/generated/fi"
+ :base-extension "org"
+ :publishing-function org-html-publish-to-html
+ :recursive t
+ :with-toc nil
+ :lang "fi"
+ :html-head "<link rel=\"stylesheet\"href=\"/static/mystyle.css\" type=\"text/css\"/>")
+ ("en"
+ :base-directory "~/Documents/orgsite/pages/en"
+ :publishing-directory "~/Documents/orgsite/generated/en"
+ :base-extension "org"
+ :publishing-function org-html-publish-to-html
+ :recursive t
+ :with-toc nil
+ :lang "en"
+ :html-head "<link rel=\"stylesheet\"href=\"/static/style.css\" type=\"text/css\"/>")
+ ("img" ; equiv with static
+ :base-directory "~/Documents/orgsite/img"
+ :publishing-directory "~/Documents/orgsite/generated/img"
+ :base-extension any
+ :recursive t
+ :publishing-function org-publish-attachment)
+ ("static" ; equiv with img
+ :base-directory "~/Documents/orgsite/static"
+ :publishing-directory "~/Documents/orgsite/generated/static"
+ :base-extension any
+ :recursive t
+ :publishing-function org-publish-attachment)
+ ("website" :components ("fi" "en" "img" "static"))))