diff --git a/.gitignore b/.gitignore
index 4fe4bf7..a06cb97 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,3 @@
out/*
-src/*
-templates/*
files
scripts
diff --git a/exec.lisp b/exec.lisp
index 2da3611..e99a39c 100644
--- a/exec.lisp
+++ b/exec.lisp
@@ -1,12 +1,14 @@
(defun exec-command (command &key (env-vars nil))
(let* ((default-env '(("PATH" . "\"$PATH:./scripts\"")))
(combined-env (append default-env env-vars))
- (full-command (format nil "~{~a=~a~} ; ~a"
+ (cd-command "cd ./site ; ")
+ (full-command (format nil "~{~a=~a~} ; ~a~a"
(mapcan (lambda (kv) (list (car kv) (cdr kv)))
combined-env)
+ cd-command
command)))
(with-open-stream (output-stream
- (ext:run-program "/bin/sh" :arguments (list "-c" full-command)
+ (ext:run-program "/bin/bash" :arguments (list "-c" full-command)
:output :stream))
(with-output-to-string (result)
(loop for line = (read-line output-stream nil nil)
diff --git a/gen.lisp b/gen.lisp
index 4e67d1d..d2ebba8 100644
--- a/gen.lisp
+++ b/gen.lisp
@@ -2,7 +2,7 @@
(load "html.lisp")
(load "exec.lisp")
-(load "templates/page.lsp")
+(load "templates/page.lisp")
(ql:quickload "uiop")
diff --git a/src/home.lisp b/src/home.lisp
new file mode 100644
index 0000000..20155ad
--- /dev/null
+++ b/src/home.lisp
@@ -0,0 +1,44 @@
+(defun html ()
+ (page "home" `((section ()
+ (p ()
+ "I'm natalie[ee]"
+ (br)
+ "$[find files/homepage-statements/* | shuf -n1 | xargs -I % cat %]"
+ (br)
+ "I am not sure what I am going to use this site for, it only exists because I was procrastinating my calculus homework bored one day"
+ (br)
+ "website homepage visit-counter: $[echo visit >> files/home_visit_counter; cat files/home_visit_counter | wc -l]"))
+ (section ()
+ (h2 () "particularly notable pages")
+ (a (:href "/html/site-info.html") "information about this website")
+ (a (:href "/html/natalie-info.html") "information about this natalie")
+ (a (:href "/html/blog/index.html") "there is a blog. I do not frequently use it.")
+ (a (:href "/html/random-thoughts.html") "arbitrary natalie thoughts. they are interesting, sometimes")
+ (a (:href "/html/cool-sites.html") "other webloci"))
+ (section ()
+ (h2 () "directories")
+ (span () ,(exec-command "find -maxdepth 1 -type d | sed 1d | sed 's/\\.\\///g' | xargs -I% echo \"%\" | grep -v pycache | grep -v .git")))
+ (section ()
+ (h2 () "changelog")
+ (pre () ,(exec-command "cat changelog")))
+ (section ()
+ (h2 () "site file tree")
+ (p () "(as of last build)")
+ (details ()
+ (summary () "file tree hidden for brevity")
+ ,(exec-command "tree . | sed 's/^\\./site/; s/─/-/g; s/├/|/g; s/└/\\\\/g; s/│/|/g' | sed '1i
' | sed '$a'"))) + (section () + (h2 () "88x31 collection") + (span () ,(exec-command "for file in ./files/88x31/*; do (file -i \"$file\" | grep -qE 'image/') && echo \"\" || cat \"$file\"; done | shuf"))) + (section () + (h2 () "post arbitrary data to be displayed here") + "yes, I do sanitize this" (a (:href "/html/albert-hack-1.html") "
$(stat -c %y site/html/blog/posts/$file | head -c 10)