Polish admin UI and add app.static file serving.

Admin gets a sidebar shell, flash messages, empty states, and forms in-chrome; listen can nest a public directory under /static (or a custom mount).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-08-12 09:26:30 +08:00
1 parent a0c56fa352
commit db6158e9e2
16 files changed
+605 -95

No files matched your search

+1 -1
View File
@@ -7,4 +7,4 @@ cargo build -p marqdo_plugin_web
cargo run -- examples/web-site-zh/index.mq.md
```
打开 http://127.0.0.1:18082/ — `/about`、`/new`、`/admin`。
打开 http://127.0.0.1:18082/ — `/about`、`/new`、`/admin`、`/static/site.css`。
+1
View File
@@ -61,4 +61,5 @@ description: Home + /about + /new(表单嵌入)+ 后台;只用 ext/web/网
*`app` = > 网页.应用 页面=`page` 数据库=`store` 后台=True 主机=127.0.0.1 端口=18082 *
*`app` = > `app`.路由 路径=/about 页面=`about` *
*`app` = > `app`.路由 路径=/new 页面=`new` *
*`app` = > `app`.静态 目录=public 挂载=/static *
> `app`.监听
+5
View File
@@ -0,0 +1,5 @@
/* 可选站点样式 — /static/site.css */
body.site-hint::before {
content: "static ok";
display: none;
}
+1 -1
View File
@@ -7,4 +7,4 @@ cargo build -p marqdo_plugin_web
cargo run -- examples/web-site/index.mq.md
```
Then open http://127.0.0.1:18081/ — `/about`, `/new` (form in page slot), `/admin`.
Then open http://127.0.0.1:18081/ — `/about`, `/new` (form in page slot), `/admin`, `/static/site.css`.
+1
View File
@@ -69,4 +69,5 @@ New article: form embedded in the page main slot (design §5.5.4).
*`app` = > web.app page=`page` db=`store` admin=True host=127.0.0.1 port=18081 *
*`app` = > `app`.route path=/about page=`about` *
*`app` = > `app`.route path=/new page=`new` *
*`app` = > `app`.static dir=public mount=/static *
> `app`.listen
+5
View File
@@ -0,0 +1,5 @@
/* Optional site stylesheet — served at /static/site.css */
body.site-hint::before {
content: "static ok";
display: none;
}