;; Set the package installation directory so that packages aren't stored in the ;; ~/.emacs.d/elpa path. (require 'package) (setq package-user-dir (expand-file-name "./.packages")) (setq package-archives '(("melpa" . "https://melpa.org/packages/") ("elpa" . "https://elpa.gnu.org/packages/"))) ;; Initialize the package system (package-initialize) (unless package-archive-contents (package-refresh-contents)) ;; Install dependencies (package-install 'htmlize) (package-install 'f) ;; Load the publishing system (require 'ox-publish) (require 'f) ;; Customize the HTML output (setq org-html-validation-link nil ;; Don't show validation link org-html-head-include-scripts nil ;; Use our own scripts org-html-head-include-default-style nil ;; Use our own styles ;; org-html-head "") ;; @TODO fix favicon link ;; @TODO ) (defvar novelli-html-head "") (defvar novelli-html-head-nested-1 (replace-regexp-in-string "../assets" "../../assets" novelli-html-head)) ;; Read assets lio.txt (defvar novelli-header (concat "
" (f-read "assets/lio.txt" 'utf-8) "
")) ;; Define the publishing project (setq org-publish-project-alist (list (list "org-site:main" :recursive t :base-directory "./content" :publishing-function 'org-html-publish-to-html :publishing-directory "./public" :with-author nil ;; Don't include author name :with-creator t ;; Include Emacs and Org versions in footer :with-toc t ;; Include a table of contents :section-numbers nil ;; Don't include section numbers :html-head novelli-html-head :html-preamble novelli-header :time-stamp-file nil) (list "org-site:en" :recursive t :base-directory "./en" :publishing-function 'org-html-publish-to-html :publishing-directory "./public/en" :with-author nil ;; Don't include author name :with-creator t ;; Include Emacs and Org versions in footer :with-toc t ;; Include a table of contents :section-numbers nil ;; Don't include section numbers :html-head novelli-html-head-nested-1 :html-preamble novelli-header :time-stamp-file nil ) (list "org-site:assets" :base-directory "./assets" :publishing-function 'org-publish-attachment :base-extension "css\\|js\\|ttf\\|woff2\\|ico" :publishing-directory "./assets" ) )) ;; Don't include time stamp in file ;; Generate the site output (org-publish-all t) (message "Build complete!")