From 7f261ca5fe336d3d3a0ab9147fd7a5feecdaf36c Mon Sep 17 00:00:00 2001 From: s-ol Date: Tue, 8 Oct 2019 14:46:16 +0200 Subject: change static path to work with static content --- .gitignore | 1 - Tupfile | 2 +- build/server.moon | 4 ++-- mmm/Tupdefault | 1 - mmm/mmmfs/layout.moon | 8 ++++---- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index d8591a3..031652c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,3 @@ db.sqlite3 .tup /.gitignore /out -/static diff --git a/Tupfile b/Tupfile index 4c8ab29..29388cf 100644 --- a/Tupfile +++ b/Tupfile @@ -14,4 +14,4 @@ include_rules : mmm/.bundle.lua | |> ^ WRAP %d^ moon &(build)/bundle_module.moon %o --wrap %f |> static/mmm.bundle.lua # copy for static builds -: foreach static/* |> cp %f out/ |> out/%b +: foreach static/* |> cp %f out/.static/ |> out/.static/%b diff --git a/build/server.moon b/build/server.moon index 4749736..a9b8431 100644 --- a/build/server.moon +++ b/build/server.moon @@ -77,7 +77,7 @@ class Server 501, "not implemented" handle_static: (method, path, stream) => - path = path\match '^/%?static/(.*)' + path = path\match '^/%.static/(.*)' return unless path respond = (code, type, body) -> @@ -93,7 +93,7 @@ class Server respond '405', 'text/plain', "can only GET/HEAD static resources" return true - if path\match '^%.' or path\match '^%~' + if path\match '%.%.' or path\match '^%~' respond '404', 'text/plain', "not found" return diff --git a/mmm/Tupdefault b/mmm/Tupdefault index 3a0783f..8035ed5 100644 --- a/mmm/Tupdefault +++ b/mmm/Tupdefault @@ -1,5 +1,4 @@ include_rules - : foreach *.moon |> ^ MOON %f^ moonc -p > %o %f |> %B.lua : |> ^ BNDL %d^ moon &(build)/bundle_module.moon %o %d % |> .bundle.lua ../ diff --git a/mmm/mmmfs/layout.moon b/mmm/mmmfs/layout.moon index 7312cb5..0fbf553 100644 --- a/mmm/mmmfs/layout.moon +++ b/mmm/mmmfs/layout.moon @@ -129,7 +129,7 @@ render = (content, fileder, opts={}) -> - + ]] buf ..= " @@ -143,12 +143,12 @@ render = (content, fileder, opts={}) -> #{footer} " buf ..= [[ - + - - + + ]] -- cgit v1.2.3