mirror of
https://onedev.site.tesses.net/crosslang/crosslangextras
synced 2026-02-08 17:15:45 +00:00
Add json listing for crosslang new
This commit is contained in:
@@ -13,20 +13,23 @@ func Components.Shell(title,pages,body)
|
||||
<h1>%PROJECT_NAME%</h1>
|
||||
<nav>
|
||||
<ul>
|
||||
<?code
|
||||
each(var item : pages)
|
||||
{
|
||||
?>
|
||||
<li><a <?code if(item.active) { ?> aria-current="page" <?code } ?> href="<?expr Net.Http.UrlPathEncode(item.route) ?>"><?expr Net.Http.HtmlEncode(item.text) ?></a></li>
|
||||
<?code
|
||||
}
|
||||
?>
|
||||
<each(var item : pages)>
|
||||
<li>
|
||||
<if(item.active)>
|
||||
<true>
|
||||
<a aria-current="page" href={item.route}>{item.text}</a>
|
||||
</true>
|
||||
<false>
|
||||
<a aria-current="page" href={item.route}>{item.text}</a>
|
||||
</false>
|
||||
</if>
|
||||
</li>
|
||||
</each>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<h1><?expr Net.Http.HtmlEncode(title) ?></h1>
|
||||
<?body?>
|
||||
<?end?>
|
||||
<h1>{title}</h1>
|
||||
<raw(body)>
|
||||
<footer>
|
||||
<p>Created using <a href="https://crosslang.tesseslanguage.com/">CrossLang</a> and <a href="https://simplecss.org/">SimpleCSS</a></p>
|
||||
</footer>
|
||||
|
||||
@@ -7,7 +7,27 @@ func main(args)
|
||||
ctx.WithMimeType("text/html").SendText(Pages.Index());
|
||||
return true;
|
||||
}
|
||||
else if(ctx.Path == "/simple.min.css")
|
||||
else if(ctx.Path == "/counter")
|
||||
{
|
||||
ctx.WithMimeType("text/html").SendText(Pages.Counter());
|
||||
return true;
|
||||
}
|
||||
else if(ctx.Path == "/about")
|
||||
{
|
||||
ctx.WithMimeType("text/html").SendText(Pages.Index());
|
||||
return true;
|
||||
}
|
||||
else if(ctx.Path == "/echo")
|
||||
{
|
||||
ctx.WithMimeType("text/html").SendText(Pages.Echo(ctx.QueryParams.TryGetFirst("text")));
|
||||
return true;
|
||||
}
|
||||
else if(ctx.Path == "/image.png")
|
||||
{
|
||||
ctx.WithMimeType("image/png").SendBytes(embed("image.png"));
|
||||
return true;
|
||||
}
|
||||
else if(ctx.Path == "/css/simple.min.css")
|
||||
{
|
||||
ctx.WithMimeType("text/css").SendBytes(embed("simple.min.css"));
|
||||
return true;
|
||||
@@ -17,5 +37,6 @@ func main(args)
|
||||
ctx.WithMimeType("image/x-icon").SendBytes(embed("favicon.ico"));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},4206);
|
||||
}
|
||||
Reference in New Issue
Block a user