Added nix package that build site from org mode
This commit is contained in:
parent
631e7c2237
commit
94ab268ab9
6 changed files with 110 additions and 66 deletions
46
package.nix
Normal file
46
package.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
stdenvNoCC,
|
||||
writeText,
|
||||
emacs,
|
||||
}: let
|
||||
src = ./.;
|
||||
buildScript = writeText "build-site.el" ''
|
||||
;; Load the publishing system
|
||||
(require 'ox-publish)
|
||||
;; Define the publishing project
|
||||
(setq org-publish-project-alist
|
||||
(list
|
||||
(list "kylekrein's website"
|
||||
:recursive t
|
||||
:base-directory "${src}"
|
||||
:publishing-directory "./public"
|
||||
:publishing-function 'org-html-publish-to-html
|
||||
:with-author nil ;; Don't include author name
|
||||
:with-creator t ;; Include Emacs and Org versions in footer
|
||||
:with-toc nil ;; Include a table of contents
|
||||
:section-numbers nil ;; Don't include section numbers
|
||||
:time-stamp-file nil))) ;; Don't include time stamp in file
|
||||
|
||||
;; 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 "<link rel=\"stylesheet\" href=\"${./style.css}\" />")
|
||||
|
||||
;; Generate the site output
|
||||
(org-publish-all t)
|
||||
(message "Build complete!")
|
||||
'';
|
||||
in
|
||||
stdenvNoCC.mkDerivation {
|
||||
name = "KyleKrein's Website";
|
||||
inherit src;
|
||||
buildPhase = ''
|
||||
HOME=$(pwd) ${emacs}/bin/emacs -Q --script ${buildScript}
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cd public
|
||||
cp -r . $out/
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue