mirror of
https://github.com/worpet-bildet/blog.git
synced 2024-09-11 16:35:35 +03:00
.md working again
This commit is contained in:
parent
7dc6cdfcdc
commit
262b62a82e
@ -77,17 +77,26 @@
|
||||
++ handle-http-request
|
||||
|= [=bowl:gall rid=@tas req=inbound-request:eyre]
|
||||
^- (quip card _this)
|
||||
=/ got (~(got by files) (rash url.request.req stap))
|
||||
=/ url-len (met 3 url.request.req)
|
||||
?: =('.md' (cut 3 [(sub url-len 3) 3] url.request.req)) :: get MARKDOWN
|
||||
=/ file (rash (end [3 (sub url-len 3)] url.request.req) stap)
|
||||
:_ this
|
||||
%^ http-response-cards:blog-lib
|
||||
rid
|
||||
[200 ['Content-Type' 'text/plain; charset=utf-8']~]
|
||||
`(as-octs:mimes:html md:(~(got by files) file))
|
||||
::
|
||||
=? url.request.req =('.html' (cut 3 [(sub url-len 5) 5] url.request.req))
|
||||
(end [3 (sub url-len 5)] url.request.req)
|
||||
=/ file (~(got by files) (rash url.request.req stap))
|
||||
=/ theme (~(got by themes) theme.file)
|
||||
=/ post-with-style
|
||||
(cat 3 html:file (add-style:blog-lib theme))
|
||||
:_ this
|
||||
%^ http-response-cards:blog-lib
|
||||
rid
|
||||
[200 ['Content-Type' 'text/html; charset=utf-8']~]
|
||||
%- some
|
||||
%- as-octs:mimes:html
|
||||
%- crip
|
||||
%+ weld
|
||||
(trip html.got)
|
||||
(add-style:blog-lib (~(got by themes) theme.got))
|
||||
`(as-octs:mimes:html post-with-style)
|
||||
::
|
||||
++ handle-action
|
||||
|= [=bowl:gall act=action:blog]
|
||||
|
@ -20,8 +20,8 @@
|
||||
::
|
||||
++ add-style
|
||||
|= css=@t
|
||||
^- tape
|
||||
:(weld "<style>" (trip css) "<style/>")
|
||||
^- @t
|
||||
(cat 3 (cat 3 '<style>' css) '<style/>')
|
||||
::
|
||||
++ http-response-cards
|
||||
|= [id=@tas hed=response-header:http data=(unit octs)]
|
||||
|
Loading…
Reference in New Issue
Block a user