mirror of
https://github.com/tadad/blog.git
synced 2024-09-11 12:55:07 +03:00
ability to serve md added
This commit is contained in:
parent
32c04919ef
commit
d821feec79
@ -41,8 +41,9 @@
|
|||||||
^- (unit (unit cage))
|
^- (unit (unit cage))
|
||||||
?+ path ~
|
?+ path ~
|
||||||
::
|
::
|
||||||
[%x %md ^] ``json+!>([%s q:(~(got by files) t.t.path)])
|
[%x %md ^] ``blog+!>(q:(~(got by files) t.t.path))
|
||||||
[%x %html ^] ``noun+!>(p:(~(got by files) t.t.path))
|
[%x %html ^] ``blog+!>(p:(~(got by files) t.t.path))
|
||||||
|
::
|
||||||
[%x %pages ~]
|
[%x %pages ~]
|
||||||
:^ ~ ~ %json
|
:^ ~ ~ %json
|
||||||
!> :- %a
|
!> :- %a
|
||||||
|
@ -1,15 +1,24 @@
|
|||||||
|= [[now=@da eny=@uvJ byk=beak] ~ ~]
|
|= [[now=@da eny=@uvJ byk=beak] ~ ~]
|
||||||
|= [authenticated=? =request:http]
|
|= [authenticated=? =request:http]
|
||||||
^- simple-payload:http
|
^- simple-payload:http
|
||||||
=* data
|
=/ turl=tape (trip url.request)
|
||||||
%- as-octs:mimes:html
|
=/ turl-len (lent turl)
|
||||||
.^ @t
|
=/ scry-path=@t
|
||||||
%gx
|
=+ md=(find ".md" turl)
|
||||||
;: weld
|
?: &(?=(^ md) =((add u.md 3) turl-len))
|
||||||
/(scot %p p.byk)/blog/(scot r.byk)/html
|
(crip (weld "/md" (swag [0 (sub turl-len 3)] turl)))
|
||||||
(pa:dejs:format [%s url.request])
|
=+ html=(find ".html" turl)
|
||||||
/noun
|
?: &(?=(^ html) =((add u.html 5) turl-len))
|
||||||
==
|
(crip (weld "/html" (swag [0 (sub turl-len 5)] turl)))
|
||||||
==
|
(crip (weld "/html" turl))
|
||||||
:_ `(unit octs)``data
|
::
|
||||||
`response-header:http`[200 ['Content-Type' 'text/html; charset=utf-8']~]
|
^- [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
|
||||||
|
==
|
||||||
|
==
|
1
lib/dbug.hoon
Symbolic link
1
lib/dbug.hoon
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../arvo/lib/dbug.hoon
|
1
lib/default-agent.hoon
Symbolic link
1
lib/default-agent.hoon
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../arvo/lib/default-agent.hoon
|
1
lib/skeleton.hoon
Symbolic link
1
lib/skeleton.hoon
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../arvo/lib/skeleton.hoon
|
@ -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
|
|
||||||
--
|
|
16
mar/blog.hoon
Normal file
16
mar/blog.hoon
Normal file
@ -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
|
||||||
|
--
|
1
mar/noun.hoon
Symbolic link
1
mar/noun.hoon
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../arvo/mar/noun.hoon
|
1
mar/ship.hoon
Symbolic link
1
mar/ship.hoon
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../arvo/mar/ship.hoon
|
Loading…
Reference in New Issue
Block a user