diff --git a/app/blog.hoon b/app/blog.hoon index 4c2a279..67a39bc 100644 --- a/app/blog.hoon +++ b/app/blog.hoon @@ -36,26 +36,22 @@ %blog-action =+ !<(act=action:blog vase) ?- -.act - %blog-bind + %unbind-post :: TODO probably dont' need this :_ this - [%pass /bind %arvo %e %connect `path.act dap.bowl]~ - :: - %blog-unbind - :_ this - [%pass /bind %arvo %e %disconnect `path.act]~ + [%pass /bind %arvo %e %disconnect `bind.act]~ :: %save-file ~& > text.act ~& > file.act :: /=blog=/blogs/... - =* file - %+ weld - /(scot %p our.bowl)/blog/(scot %da now.bowl)/blogs - file.act + =* file [%posts file.act] =* nor `nori:clay`[%& [file %ins %html !>(text.act)]~] - [%pass / %arvo %c %info %blog nor]~^this + :_ this + :~ [%pass / %arvo %c %info %blog nor] + [%pass /serve %arvo %e %serve `file.act dap.bowl /gen/blog/hoon ~] + == :: - %delete-file + %delete-file :: TODO unbind here as well =* nor `nori:clay`[%& [file.act %del ~]~] [%pass / %arvo %c %info %blog nor]~^this == @@ -70,12 +66,16 @@ ^- (unit (unit cage)) ?+ path ~ :: - :: [%x %existing-bindings ~] - :: =* pax /(scot %p our.bowl)/bindings/(scot %da now.bowl) - :: :^ ~ ~ %bindings !> - :: .^((list [binding:eyre duct action:eyre]) %e pax) + [%x %existing-bindings ~] + =* pax /(scot %p our.bowl)/bindings/(scot %da now.bowl) + :^ ~ ~ %bindings !> + .^((list [binding:eyre duct action:eyre]) %e pax) :: - [%x %blog ^] + [%x %posts ~] + =* pax /(scot %p our.bowl)/blog/(scot %da now.bowl)/blogs + ``arch+!>((turn ~(tap by dir:.^(arch %cy pax)) head)) + :: + [%x %content ^] :^ ~ ~ %html !> ^- cord %- of-wain:format @@ -92,7 +92,7 @@ |= [=wire =sign-arvo] ^- (quip card _this) ?+ wire (on-arvo:def wire sign-arvo) - [%bind ~] + [%serve ~] ?> ?=(%eyre -.sign-arvo) ?> ?=(%bound +<.sign-arvo) ?- accepted.sign-arvo diff --git a/gen/blog.hoon b/gen/blog.hoon new file mode 100644 index 0000000..351f986 --- /dev/null +++ b/gen/blog.hoon @@ -0,0 +1,13 @@ +|= [[now=@da eny=@uvJ byk=beak] ~ ~] +|= [authenticated=? =request:http] +^- simple-payload:http +=* data + %- as-octs:mimes:html + .^ @t + %cx + %+ weld + /(scot %p p.byk)/blog/(scot r.byk)/posts + (pa:dejs:format [%s url.request]) + == +:_ `(unit octs)``data +`response-header:http`[200 ['Content-Type' 'text/html']~] diff --git a/mar/arch.hoon b/mar/arch.hoon new file mode 100644 index 0000000..ff1dfa5 --- /dev/null +++ b/mar/arch.hoon @@ -0,0 +1,16 @@ +|_ arch=(list @ta) +:: +++ grab + |% + ++ noun (list @ta) + -- +:: +++ grow + |% + ++ noun arch + ++ json + [%a (turn arch |=(c=@ta [%s c]))] + -- +:: +++ grad %noun +-- diff --git a/mar/bill.hoon b/mar/bill.hoon new file mode 120000 index 0000000..801d997 --- /dev/null +++ b/mar/bill.hoon @@ -0,0 +1 @@ +../../base-dev/mar/bill.hoon \ No newline at end of file diff --git a/mar/bindings.hoon b/mar/bindings.hoon new file mode 100644 index 0000000..cab9109 --- /dev/null +++ b/mar/bindings.hoon @@ -0,0 +1,19 @@ +|_ 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/action.hoon b/mar/blog/action.hoon index 44c7a6b..c0d360a 100644 --- a/mar/blog/action.hoon +++ b/mar/blog/action.hoon @@ -5,12 +5,9 @@ |% ++ noun action:blog ++ json - |= jon=^json =, dejs:format - ^- action:pyro %- of - :~ [%blog-bind pa] - [%blog-unbind pa] + :~ [%unbind-post pa] [%save-file (ot ~[file+pa text+so])] [%delete-file pa] == diff --git a/sur/blog.hoon b/sur/blog.hoon index ccb31a2..97fcfae 100644 --- a/sur/blog.hoon +++ b/sur/blog.hoon @@ -1,7 +1,6 @@ |% +$ action - $% [%blog-bind =path] - [%blog-unbind =path] + $% [%unbind-post bind=path] [%save-file file=path text=@t] [%delete-file file=path] ==