IMPORTANT NOTICE: Devheroes public code hosting will shut down at 1st of March 2023. Due to some difficulties, we have to shut down the instance. Since is pretty mature and welcoming, We highly recommend you to move your code there. Please be advised that on 1st of March, your data will be removed. Thanks for your time with us, and may the source be with you.

My nest. My website
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.7 KiB

:;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 -*- lexical-binding: t; -*-
;; Copyright (c) 2020-2022 Sameer Rahmani & Contributors
;;; Version: 0.1.0
;;; Package-Version 0.1.0
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with thnis program. If not, see <>.
;;; 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/utils)
(require 'fg42/build/core)
(defconst build/usage "
build.el [PARAMS] COMMAND [...]
docs - Build the documents and convert them to HTML
:d - Turns on the debug mode.
:e expr - Run the given `expr' before any operation.
project-root (nth 2 command-line-args-left)
docs-root "/orgs"
usage build/usage
prod-base-url ""
docs-pages-dir "/essays"
docs-actions '(copy-necessary-files)
docs-ignore-category-check '("")
docs-title ""
docs-desc "The little nest of mine")
(defun copy-necessary-files (build-dir base-url)
"Copy the top level pages to the BUILD-DIR with BASE-URL."
(copy-file (expand-file-name "orgs/" fg42/build-project-root)
(expand-file-name "site/" build-dir))
(copy-file (expand-file-name "orgs/" fg42/build-project-root)
(expand-file-name "site/" build-dir))
(copy-file (expand-file-name "orgs/" fg42/build-project-root)
(expand-file-name "site/" build-dir))
(copy-file (expand-file-name "" fg42/build-project-root)
(expand-file-name "" build-dir)))
(command-> command args
((string= command "docs")
(require 'fg42/build/docs)
(fg42/build-docs build-dir))))
(provide 'build)
;; Local Variables:
;; mode: emacs-lisp
;; End:
;;; build.el ends here