From d02be1f2a460291b9403dabbbfb087d3adfe44f3 Mon Sep 17 00:00:00 2001 From: Sorrel <52061229+sorrelbri@users.noreply.github.com> Date: Wed, 1 Nov 2023 18:32:17 -0400 Subject: [PATCH] add ability to parse atom.txt with bound values --- sorrel.dev.rkt | 14 ++++------- source/about.txt | 61 ++++++++++++++++++++++++++--------------------- source/atom.txt | 25 +++++++++---------- source/header.txt | 4 +++- 4 files changed, 53 insertions(+), 51 deletions(-) diff --git a/sorrel.dev.rkt b/sorrel.dev.rkt index 1d97edd..e124d2d 100644 --- a/sorrel.dev.rkt +++ b/sorrel.dev.rkt @@ -13,6 +13,9 @@ web-server/dispatchers/filesystem-map web-server/http) +(define-namespace-anchor anc) +(define ns (namespace-anchor->namespace anc)) + (define (html-response content) (response/full @@ -116,15 +119,8 @@ [homepage "https://sorrel.dev"]) ;; hard coding for now because reader can't be escaped (define content - `(feed - ((xmlns "http://www.w3.org/2005/Atom")) - (title "λ.sorrel.dev") - (link ((rel "self") - (href ,feed-ref))) - (updated ,update-time) - (author - (name "sorrel")) - (id ,homepage))) + ((eval (read (open-input-file "source/atom.txt")) ns) + feed-ref update-time homepage)) (xml-response (string->bytes/utf-8 (string-append "" (xexpr->string content)))))) diff --git a/source/about.txt b/source/about.txt index 6028f62..c415a7b 100644 --- a/source/about.txt +++ b/source/about.txt @@ -1,26 +1,11 @@ (main (p "what do you want to know?") - (h1 "about sorrel") - (p "i'm a gay lil nerd who's learning everyday about community, and ecology, + (section + (h1 "about sorrel") + (p "i'm a gay lil nerd who's learning everyday about community, and ecology, and computer; and trying hard to be good for the world with my gay lil friends.") - (section - (h2 "contact") - (p "- e - m- " - (span " a - i ") - (span " -l [ at ") - (span "] s - o- ") - (span "r - r- e - l [ d o") - (span "t ] d -e") - (span "-v is a good place to do the email")) - (p - "i have avoided 'online' for a long time, but i'm getting hip to it. i'll - add some more socials here for to socially network in the future, - promise.")) - (section - (h2 "a bio or smth") - (p - "i am a little bug that was named after " + (p "i was named after " (a ((href "https://plants.usda.gov/home/plantProfile?symbol=OXOR")) "a plant called sorrel") " and i live in the mountains of southern appalachia on " @@ -60,6 +45,7 @@ ;; mmt bullet (li (p "mmt, but make it anarchist " (small "and get rid of all that \"sovereignty\" stuff, ew"))) + ;; nd bullet (li (p "the autistic-contiguous position: object-relations theory or gay sex act? " (span @@ -70,20 +56,41 @@ (hx-target "closest span.hx-target") (hx-swap "innerHTML")) "a ~type~ of experience"))))) - (li (p "being trans and gay")) - (li (p "א ⃝")))) + ;; queer bullet + (li (p "she's a gay trans lady, harold")) + ;; art bullet + (li (p "i used to make a lot more visual art than i do these days. some + sort of smth'll wind up here at some point.")))) +;; contact section + (section + (h2 "contact") + (p "- e - m- " + (span " a - i ") + (span " -l [ at ") + (span "] s - o- ") + (span "r - r- e - l [ d o") + (span "t ] d -e") + (span "-v is a good place to do the email")) + (p + "i have avoided 'online' for a long time, but i'm getting hip to it. i'll + add some more socials here for to socially network in the future, + promise.")) +;; getting earnest section (section (h2 "a very earnest disclaimer") (p "i like to talk about computation with ppl! but it is important for me that - you know: i am new to all this! i did not think software was ^for me^ and - then i learned some webdev and now i am down the rabbit hole.") + you know: i am new to all this! i did not think computers or software were + ^for me^ and then i had to get good at spreadsheets at my first email-factory + job and then i got curious about webdev and now i have reached terminal + velocity down a very λ.particular.rabbit[hole]") (p - "i'm not very good at many things. i don't even have a math education or. - have you ever met someone who *is* good at all this stuff?") + "i'm not very good at many things. i don't even have a math education or a + degree in anything. have you ever met someone who *is* good at _all_ ^this^ + ~stuff~ ???") (p - "please be patient! with me and with everyone else you talk about things - you care about with.") + "i like thinking in public, but please be patient! with me and with + everyone else you talk about things you care about with.") (p "let's hold our strong opinions loosely!") (p "and first assume good faith from each other!") (br) diff --git a/source/atom.txt b/source/atom.txt index 2ca9e87..141ae89 100644 --- a/source/atom.txt +++ b/source/atom.txt @@ -1,16 +1,13 @@ -;; required on update -;; -- (let (feed-ref "https://URI/atom") -;; (update-time - -(feed - ((xmlns "http://www.w3.org/2005/Atom")) - (title "λ.sorrel.dev") - (link ((rel "self") - (href ,feed-ref))) - (updated ,update-time) - (author - (name "sorrel")) - (id ,homepage) +(lambda (feed-ref update-time homepage) + `(feed + ((xmlns "http://www.w3.org/2005/Atom")) + (title "λ.sorrel.dev") + (link ((rel "self") + (href ,feed-ref))) + (updated ,update-time) + (author + (name "sorrel")) + (id ,homepage) ; ,(map ; (lambda (item) @@ -25,4 +22,4 @@ ; (categories item)) ; (updated ,(updated item))) ; items)) - ) \ No newline at end of file + )) \ No newline at end of file diff --git a/source/header.txt b/source/header.txt index 700306a..1a3cf70 100644 --- a/source/header.txt +++ b/source/header.txt @@ -64,4 +64,6 @@ (hx-get "/hx/settleds") (hx-target "main") (hx-swap "innerHTML")) - "\"settled\" thoughts (projects built/in progress)"))) + "\"settled\" thoughts (projects built/in progress)") + (a ((href "/feed.atom")) + "þͤ olde rss")))