lxhome/build.el

67 lines
1.6 KiB
EmacsLisp
Executable File

:;exec `echo $EMACS_PATH` --no-site-file --no-site-lisp --batch -L ./ -l "$0" -f main "$(cd "$(dirname "$0")/." >/dev/null 2>&1 ; pwd -P)" "$@"
;;; build.el --- The build script of my personal website
;;; Version: 0.1.0
;;; Package-Version 0.1.0
;;; Commentary:
;;; Code:
(setq debug-on-error t)
(setenv "FG42_HOME" (concat (getenv "HOME") "/.fg42/"))
(defconst fg42/CORE_DIR (concat (getenv "FG42_HOME") "core"))
(setq user-emacs-directory (concat (getenv "FG42_HOME") "emacs.d"))
(add-to-list 'load-path fg42/CORE_DIR)
(require 'fg42/build/core)
(require 'fg42/build/utils)
(defconst build/usage "
Usage:
build.el [PARAMS] COMMAND [...]
COMMANDS:
docs - Build the documents and convert them to HTML
PARAMS:
:d - Turns on the debug mode.
:e expr - Run the given `expr' before any operation.
")
(defproject lxsameer.com
project-root (nth 2 command-line-args-left)
docs-root "/orgs"
prod-base-url "lxsameer.com"
docs-pages-dir "/essays"
docs-actions '(copy-necessary-files)
docs-ignore-category-check '("thoughts.org")
)
(defun copy-necessary-files (build-dir base-url)
(copy-file (expand-file-name "thoughts.org" fg42/build-project-root)
(expand-file-name "thoughts.org" build-dir)))
(command-> command args
((string= command "docs")
(do-command
(require 'fpkg)
(fpkg/use dash)
(fpkg/use mustache)
(fpkg/use ht)
(fpkg/use htmlize)
(require 'fg42/build/docs)
(fg42/build-docs build-dir))))
(provide 'build)
;; Local Variables:
;; mode: emacs-lisp
;; End:
;;; build.el ends here