diff --git a/app/blog.hoon b/app/blog.hoon index 6a846be..a5b7381 100644 --- a/app/blog.hoon +++ b/app/blog.hoon @@ -31,7 +31,7 @@ `this(themes (~(gas by themes) [%default default-theme:blog-lib]~)) ++ on-save !>(state) ++ on-load - |= =vase + |= =vase ^- (quip card _this) =+ !<(old=versioned-state vase) ?- -.old @@ -140,6 +140,38 @@ =; theme ``json+!>(s+theme) theme:(~(got by files) t.t.path) :: + [%x %export ~] + =; export ``json+!>(export) + %- pairs:enjs:format + :~ + :- 'published' + :- %a + %+ turn ~(tap by files) + |= [=^path html=@t md=@t theme=@tas] + :- %a + :~ (path:enjs:format path) + (tape:enjs:format [html ~]) + (tape:enjs:format [md ~]) + s+theme + == + :- 'drafts' + :- %a + %+ turn ~(tap by drafts) + |= [=^path md=@t] + :- %a + :~ (path:enjs:format path) + (tape:enjs:format [md ~]) + == + :- 'themes' + :- %a + %+ turn ~(tap by themes) + |= [theme=@tas css=@t] + :- %a + :~ (path:enjs:format [theme ~]) + (tape:enjs:format [css ~]) + == + == + :: [%x %all-bindings ~] =; the-thing ``json+!>(the-thing) %- pairs:enjs:format diff --git a/gen/blog-export.hoon b/gen/blog-export.hoon new file mode 100644 index 0000000..a209490 --- /dev/null +++ b/gen/blog-export.hoon @@ -0,0 +1,4 @@ +:- %say +|= [[now=@da @ our=@p ^] *] +:- %json +.^(json %gx /(scot %p our)/blog/(scot %da now)/export/json) \ No newline at end of file