mirror of
https://github.com/tadad/blog.git
synced 2024-09-11 12:55:07 +03:00
scries fixed, save > publish
This commit is contained in:
parent
5c8bfe42ea
commit
3c590deb7f
@ -11,7 +11,7 @@
|
||||
+$ state-1
|
||||
$: %1
|
||||
files=(map path (pair html=@t md=@t))
|
||||
drafts=(map term md=@t)
|
||||
drafts=(map path md=@t)
|
||||
==
|
||||
--
|
||||
=| state-1
|
||||
@ -40,19 +40,19 @@
|
||||
?> =(%blog-action mark)
|
||||
=+ !<(act=action:blog vase)
|
||||
?- -.act
|
||||
%save-file
|
||||
%publish
|
||||
:_ this(files (~(put by files) [path html md]:act))
|
||||
[%pass /bind %arvo %e %serve `path.act dap.bowl /gen/blog/hoon ~]~
|
||||
::
|
||||
%delete-file
|
||||
%unpublish
|
||||
:_ this(files (~(del by files) path.act))
|
||||
[%pass /bind %arvo %e %disconnect `path.act]~
|
||||
::
|
||||
%save-draft
|
||||
`this(drafts (~(put by drafts) [name md]:act))
|
||||
`this(drafts (~(put by drafts) [path md]:act))
|
||||
::
|
||||
%delete-draft
|
||||
`this(drafts (~(del by drafts) name.act))
|
||||
`this(drafts (~(del by drafts) path.act))
|
||||
==
|
||||
++ on-agent on-agent:def
|
||||
++ on-watch on-watch:def
|
||||
@ -61,9 +61,12 @@
|
||||
^- (unit (unit cage))
|
||||
?+ path ~
|
||||
::
|
||||
[%x %md ^] ``blog+!>(q:(~(got by files) t.t.path))
|
||||
[%x %html ^] ``blog+!>(p:(~(got by files) t.t.path))
|
||||
[%x %draft @ ~] ``blog+!>((~(got by drafts) i.t.t.path))
|
||||
[%x %md ^] ``blog+!>(q:(~(got by files) t.t.path))
|
||||
[%x %html ^] ``blog+!>(p:(~(got by files) t.t.path))
|
||||
[%x %draft ^]
|
||||
~& > t.t.path
|
||||
~& > (~(has by drafts) t.t.path)
|
||||
``blog+!>((~(got by drafts) t.t.path))
|
||||
::
|
||||
[%x %pages ~]
|
||||
=; pages ``json+!>([%a pages])
|
||||
@ -71,7 +74,7 @@
|
||||
::
|
||||
[%x %drafts ~]
|
||||
=; names ``json+!>([%a names])
|
||||
(turn ~(tap by drafts) |=([t=term *] [%s t]))
|
||||
(turn ~(tap by drafts) |=([=^path *] (path:enjs:format path)))
|
||||
::
|
||||
[%x %all-bindings ~]
|
||||
=; the-thing ``json+!>(the-thing)
|
||||
@ -90,7 +93,7 @@
|
||||
%logout [%s '%logout']
|
||||
%channel [%s '%channel']
|
||||
%scry [%s '%scry']
|
||||
%name [%s '%name']
|
||||
:: %name [%s '%name'] :: TODO next release
|
||||
%four-oh-four [%s '%four-oh-four']
|
||||
==
|
||||
==
|
||||
|
@ -7,8 +7,10 @@
|
||||
++ json
|
||||
=, dejs:format
|
||||
%- of
|
||||
:~ [%save-file (ot ~[path+pa html+so md+so])]
|
||||
[%delete-file (ot ~[path+pa])]
|
||||
:~ [%publish (ot ~[path+pa html+so md+so])]
|
||||
[%unpublish (ot ~[path+pa])]
|
||||
[%save-draft (ot ~[path+pa md+so])]
|
||||
[%delete-draft (ot ~[path+pa])]
|
||||
==
|
||||
--
|
||||
::
|
||||
|
@ -1,8 +1,8 @@
|
||||
|%
|
||||
+$ action
|
||||
$% [%save-file =path html=@t md=@t] :: TODO needs to be text and md
|
||||
[%delete-file =path]
|
||||
[%save-draft name=term md=@t]
|
||||
[%delete-draft name=term]
|
||||
$% [%publish =path html=@t md=@t] :: TODO needs to be text and md
|
||||
[%unpublish =path]
|
||||
[%save-draft =path md=@t]
|
||||
[%delete-draft =path]
|
||||
==
|
||||
--
|
Loading…
Reference in New Issue
Block a user