diff --git a/app/blog.hoon b/app/blog.hoon index 70b600a..c639976 100644 --- a/app/blog.hoon +++ b/app/blog.hoon @@ -41,8 +41,9 @@ ^- (unit (unit cage)) ?+ path ~ :: - [%x %md ^] ``json+!>([%s q:(~(got by files) t.t.path)]) - [%x %html ^] ``noun+!>(p:(~(got by files) t.t.path)) + [%x %md ^] ``blog+!>(q:(~(got by files) t.t.path)) + [%x %html ^] ``blog+!>(p:(~(got by files) t.t.path)) + :: [%x %pages ~] :^ ~ ~ %json !> :- %a diff --git a/gen/blog.hoon b/gen/blog.hoon index 8056acb..2de5360 100644 --- a/gen/blog.hoon +++ b/gen/blog.hoon @@ -1,15 +1,24 @@ |= [[now=@da eny=@uvJ byk=beak] ~ ~] |= [authenticated=? =request:http] ^- simple-payload:http -=* data - %- as-octs:mimes:html - .^ @t - %gx - ;: weld - /(scot %p p.byk)/blog/(scot r.byk)/html - (pa:dejs:format [%s url.request]) - /noun - == - == -:_ `(unit octs)``data -`response-header:http`[200 ['Content-Type' 'text/html; charset=utf-8']~] \ No newline at end of file +=/ turl=tape (trip url.request) +=/ turl-len (lent turl) +=/ scry-path=@t + =+ md=(find ".md" turl) + ?: &(?=(^ md) =((add u.md 3) turl-len)) + (crip (weld "/md" (swag [0 (sub turl-len 3)] turl))) + =+ html=(find ".html" turl) + ?: &(?=(^ html) =((add u.html 5) turl-len)) + (crip (weld "/html" (swag [0 (sub turl-len 5)] turl))) + (crip (weld "/html" turl)) +:: +^- [response-header:http (unit octs)] +:- [200 ['Content-Type' 'text/html; charset=utf-8']~] +%- some +%- as-octs:mimes:html +.^ @t %gx + ;: weld + /(scot %p p.byk)/blog/(scot r.byk) + (rash scry-path stap) /noun + == +== \ No newline at end of file diff --git a/lib/dbug.hoon b/lib/dbug.hoon new file mode 120000 index 0000000..037af9c --- /dev/null +++ b/lib/dbug.hoon @@ -0,0 +1 @@ +../../arvo/lib/dbug.hoon \ No newline at end of file diff --git a/lib/default-agent.hoon b/lib/default-agent.hoon new file mode 120000 index 0000000..34a46c8 --- /dev/null +++ b/lib/default-agent.hoon @@ -0,0 +1 @@ +../../arvo/lib/default-agent.hoon \ No newline at end of file diff --git a/lib/skeleton.hoon b/lib/skeleton.hoon new file mode 120000 index 0000000..c91fe9c --- /dev/null +++ b/lib/skeleton.hoon @@ -0,0 +1 @@ +../../arvo/lib/skeleton.hoon \ No newline at end of file diff --git a/mar/bindings.hoon b/mar/bindings.hoon deleted file mode 100644 index cab9109..0000000 --- a/mar/bindings.hoon +++ /dev/null @@ -1,19 +0,0 @@ -|_ bind=(list [binding:eyre duct action:eyre]) -:: -++ grab - |% - ++ noun (list [binding:eyre duct action:eyre]) - -- -:: -++ grow - |% - ++ noun bind - ++ json - :- %a - %+ turn bind - |= [=binding:eyre duct action:eyre] - (path:enjs:format path.binding) - -- -:: -++ grad %noun --- diff --git a/mar/blog.hoon b/mar/blog.hoon new file mode 100644 index 0000000..1625d4f --- /dev/null +++ b/mar/blog.hoon @@ -0,0 +1,16 @@ +:: Realy all unix/mime stuff should look something like this but w/e +:: +|_ txt=@t +:: +++ grab + |% + ++ mime |=((pair mite octs) (@t q.q)) + ++ noun @t + -- +++ grow + |% + ++ mime [/text/plain (as-octs:mimes:html txt)] + ++ json [%s txt] + -- +++ grad %mime +-- diff --git a/mar/noun.hoon b/mar/noun.hoon new file mode 120000 index 0000000..ce183a2 --- /dev/null +++ b/mar/noun.hoon @@ -0,0 +1 @@ +../../arvo/mar/noun.hoon \ No newline at end of file diff --git a/mar/ship.hoon b/mar/ship.hoon new file mode 120000 index 0000000..a2e5625 --- /dev/null +++ b/mar/ship.hoon @@ -0,0 +1 @@ +../../arvo/mar/ship.hoon \ No newline at end of file