diff --git a/publish.el b/publish.el index 57c3708..7823a46 100644 --- a/publish.el +++ b/publish.el @@ -30,6 +30,12 @@ (require 'rainbow-delimiters) (require 'subr-x) +(defconst publish-root + (file-name-directory + (or load-file-name + (buffer-file-name))) + "The directory where ‘oni-org’ was loaded from.") + (add-hook 'prog-mode-hook 'rainbow-delimiters-mode) (defun publish-calculate-reading-time (buffer) @@ -89,5 +95,21 @@ :publishing-directory "public/") ("all" :components ("index" "posts" "assets")))) +(defvar publish-feed-url-format + ;"https://gitlab.com/ryuslash/ryuslash.org/-/commits/master/%s?feed_token=Rf8otgpS8YEiYakJN4NR&format=atom" + "https://code.ryuslash.org/new-ryuslash.org/atom/%s?h=master" + "Format string for the URL to the page’s atom feed.") + +(add-hook 'org-export-before-processing-hook + (lambda (backend) + (when (eq backend 'html) + (let ((file-name (if (string= (buffer-file-name) + (expand-file-name "index.org")) + "" + (file-relative-name (buffer-file-name) publish-root)))) + (insert "#+HTML_HEAD: \n"))))) + (provide 'publish) ;;; publish.el ends here