Add app.route for mounting extra pages by path.

Register GET routes from assembled pages; sample /about + offline smoke.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-08-12 08:57:07 +08:00
1 parent 897db76aa7
commit 0dcd9e3d03
9 files changed
+172 -15

No files matched your search

+1
View File
@@ -7,6 +7,7 @@ Static top links for the shell.
| 属性 | 值 | 样式 |
|------|-----|------|
| Home | / | |
| About | /about | |
| New | /_form/article | |
| Admin | /admin | |
+7 -1
View File
@@ -1,6 +1,6 @@
---
title: web-site
description: Home = page table; main inline; class methods assemble; form §5.5.
description: Home + /about route + form §5.5 + admin.
> ext/web/web.mq.md
> styles/shell.mq.md
> components/nav.mq.md
@@ -51,10 +51,16 @@ Article create form (design §5.5): field table + rules table.
*`page` = > `page`.compose_components components=`home` *
*`page` = > `page`.compose_main main=`index` *
About page: same shell, different intro (no main bind).
*`about` = > web.page title="About" intro="<h1>About</h1><p>Marqdo web = tables + class methods.</p>" *
*`about` = > `about`.compose_components components=`home` *
*`article_form` = > web.form table=articles action=insert *
*`article_form` = > `article_form`.fields fields=`article_fields` *
*`article_form` = > `article_form`.rules rules=`article_rules` *
*`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`.mount_form id=article form=`article_form` *
> `app`.listen