mirror of
https://git.sr.ht/~magic_rb/website
synced 2024-11-22 08:04:21 +01:00
d456ffa94d
Signed-off-by: Magic_RB <magic_rb@redalder.org>
52 lines
1.4 KiB
EmacsLisp
52 lines
1.4 KiB
EmacsLisp
;;; Package -- make.el
|
|
;;; Commentary:
|
|
;;;
|
|
|
|
;;; Code:
|
|
(load-file "./org-thtml/ox-thtml.el")
|
|
(require 'org)
|
|
(require 'ox)
|
|
(require 'ox-html)
|
|
|
|
(dolist (d '("public_html"))
|
|
(unless (file-exists-p d)
|
|
(make-directory d)))
|
|
|
|
;; https://alhassy.github.io/AlBasmala.html#Floating-TOC
|
|
(advice-add 'org-html--translate :before-until 'display-toc-as-toc)
|
|
(defun display-toc-as-toc (phrase info)
|
|
(when (equal phrase "Table of Contents")
|
|
"<a>
|
|
TOC
|
|
</a>"))
|
|
|
|
;; DOES NOT WORK https://github.com/alphapapa/unpackaged.el#export-to-html-with-useful-anchors
|
|
|
|
(defvar org-publish-project-alist)
|
|
(setq org-publish-project-alist
|
|
`(("blog-org"
|
|
:base-directory ,(expand-file-name "blog/")
|
|
:base-extension "org"
|
|
:publishing-directory ,(expand-file-name "public_html/")
|
|
:recursive t
|
|
:section-numbers nil
|
|
:with-toc nil
|
|
:with-date nil
|
|
:html-template ,(templated-html-load-template "templates/blog.html")
|
|
:publishing-function org-html-publish-to-templated-html
|
|
:headline-levels 4
|
|
:auto-preamble t)
|
|
("blog-assets"
|
|
:base-directory ,(expand-file-name "assets/")
|
|
:publishing-directory ,(expand-file-name "public_html/")
|
|
:recursive t
|
|
:base-extension "\\(ttf\\|jpg\\|gif\\|png\\|css\\|js\\|el\\|nb\\|ipynb\\|pdf\\|xml\\)"
|
|
:publishing-function org-publish-attachment)
|
|
("blog"
|
|
:components ("blog-org" "blog-assets"))))
|
|
|
|
(org-publish "blog" t)
|
|
|
|
(provide 'make)
|
|
;;; make.el ends here
|