Files
htmlgen/src/home.lisp
2024-09-05 05:14:40 -07:00

48 lines
3.5 KiB
Common Lisp

(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 <del>procrastinating my calculus homework</del> bored one day"
(br)
"website homepage visit-counter: $[echo visit >> files/home_visit_counter; cat files/home_visit_counter | wc -l]"
(br)
(br)
"if you are here, I am rather curious as to why. I encourage you to use the post arbitrary data section of this page to tell me how you found my site."))
(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 \"<a href=%>%</a>\" | 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<pre>' | sed '$a</pre>'")))
(section ()
(h2 () "88x31 collection")
(span () ,(exec-command "for file in ./files/88x31/*; do (file -i \"$file\" | grep -qE 'image/') && echo \"<img src=\\\"$file\\\" width=88 height=31/>\" || 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") "<del>(No you don't --sanitization tester)</del>") "yes I do")
(section (:class "ignore-section")
(form (:action "#" :method "post")
(label (:for "text") "post text:")
(input (:type "text" :id "text" :name "text" :required))
(label (:for "name") "username:")
(input (:type "text" :id "name" :name "name" :required))
(button (:type "submit") "submit"))
(div ()
"$[ls -r ./files/posts-to-homepage | while read -r file; do echo \"<div class=post>$(cat files/posts-to-homepage/${file})</div>\"; done]")))))