release: v0.3.1 — W8 favicon/head/images + entry_dir fix
Ship site icons, head asset tables, and image assembly; absolutize entry_dir for relative entry scripts so sqlite paths no longer nest. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
1e5e6f4891
commit
416914a346
29 files changed
+1497
-36
No files matched your search
+46
-2
@@ -30,6 +30,26 @@ merged, and a leading `|媒体|` column groups rows into `@media` blocks), or
|
||||
> ensure_plugin
|
||||
**> web_style name=`name` table=`table`**
|
||||
|
||||
## make_images
|
||||
+ `table`
|
||||
|
||||
Assemble a GFM image table into an HTML fragment (`div.mq-images` of
|
||||
`<figure class="mq-img">` / `<img>`). Columns: `src`/`alt`/`title`/`class`/
|
||||
`href`/`width`/`height`/`loading`/`caption` (ZH: `源`/`替代`/`标题`/`类`/
|
||||
`链接`/`宽度`/`高度`/`加载`/`图注`). Images stay as data — 图片即数据、装配即函数.
|
||||
|
||||
> ensure_plugin
|
||||
**> web_images table=`table`**
|
||||
|
||||
## make_head
|
||||
+ `table`
|
||||
|
||||
Assemble a Head resource table into HTML (`<link>` / `<script>`). Useful for
|
||||
preview; prefer `page.head` to attach resources to a page.
|
||||
|
||||
> ensure_plugin
|
||||
**> web_head table=`table`**
|
||||
|
||||
# page
|
||||
+ `title`="Marqdo Web"
|
||||
+ `intro`=""
|
||||
@@ -93,10 +113,24 @@ of a list of cards. Set on the dynamic post page so `/post/{slug}` shows one pos
|
||||
## meta
|
||||
+ `meta`
|
||||
|
||||
SEO / OpenGraph metadata as a data table (`|key|value|`). Keys such as `title`, `description`, `canonical`, `og:type` become `<head>` tags at render time.
|
||||
SEO / OpenGraph metadata as a data table (`|key|value|`). Keys such as `title`, `description`, `canonical`, `og:type` become `<head>` tags at render time. Special keys `icon` / `favicon` / `apple-touch-icon` emit `<link rel="…">` (not `<meta name>`).
|
||||
|
||||
**> web_page_meta page=`self` meta=`meta`**
|
||||
|
||||
## head
|
||||
+ `table`
|
||||
|
||||
Assemble `<head>` resources from a GFM table (`|rel|href|type|sizes|media|as|crossorigin|` or ZH `|关系|地址|类型|…|`). `rel=script` / `module` become `<script>`; other rows become `<link>`. Merges with any existing `head` on the page.
|
||||
|
||||
**> web_page_head page=`self` table=`table`**
|
||||
|
||||
## images
|
||||
+ `table`
|
||||
|
||||
Assemble an image table (`|src|alt|title|class|href|width|height|loading|caption|`) into HTML and attach it as `images_html` (rendered in main before intro). Same table shape as module-level `make_images`.
|
||||
|
||||
**> web_page_images page=`self` table=`table`**
|
||||
|
||||
## paginate
|
||||
+ `offset`=0
|
||||
+ `limit`=10
|
||||
@@ -429,10 +463,20 @@ Register `GET|POST /_form/{id}` for listen when the form is not already embedded
|
||||
+ `dir`
|
||||
+ `mount`=/static
|
||||
|
||||
Serve files from `dir` under `mount` (default `/static`). Path is resolved from the process working directory at listen time.
|
||||
Serve files from `dir` under `mount` (default `/static`). Path is resolved from the process working directory at listen time. If `dir` contains `favicon.ico` / `favicon.png` / `favicon.svg` and `icons` was not set, listen also serves `GET /favicon.ico` and injects a default `<link rel="icon">` on every page.
|
||||
|
||||
**> web_app_static app=`self` dir=`dir` mount=`mount`**
|
||||
|
||||
## icons
|
||||
+ `table`
|
||||
|
||||
Register site icons from a GFM table (`|path|rel|type|sizes|url|` or ZH
|
||||
`|路径|关系|类型|尺寸|地址|`). Listen serves each file at `url` (default
|
||||
`/favicon.ico` for `.ico` icons, else `/icons/{filename}`), and injects matching
|
||||
`<link>` tags into every page via `site_head`. See [web-assets-and-images.md](../../doc/design/web-assets-and-images.md).
|
||||
|
||||
**> web_app_icons app=`self` table=`table`**
|
||||
|
||||
## configure
|
||||
+ `cors`=None
|
||||
+ `security`=None
|
||||
|
||||
+41
-2
@@ -29,6 +29,24 @@ import sys:lib/sys.mq.md
|
||||
> 确保插件
|
||||
**> web_style name=`名` table=`表`**
|
||||
|
||||
## 图片装配
|
||||
+ `表`
|
||||
|
||||
把 GFM 图片表装配成 HTML 片段(`div.mq-images` 内若干 `<figure class="mq-img">`)。
|
||||
列:`源`/`替代`/`标题`/`类`/`链接`/`宽度`/`高度`/`加载`/`图注`。
|
||||
图片即数据、装配即函数。
|
||||
|
||||
> 确保插件
|
||||
**> web_images table=`表`**
|
||||
|
||||
## 头资源装配
|
||||
+ `表`
|
||||
|
||||
把 Head 资源表装配成 HTML(`<link>` / `<script>`)。预览用;挂到页面请用 `页面.头装配`。
|
||||
|
||||
> 确保插件
|
||||
**> web_head table=`表`**
|
||||
|
||||
# 页面
|
||||
+ `标题`="站点"
|
||||
+ `引言`=""
|
||||
@@ -84,10 +102,24 @@ import sys:lib/sys.mq.md
|
||||
## 元数据
|
||||
+ `元数据`
|
||||
|
||||
SEO / OpenGraph 元数据表(`|键|值|`)。如 `title`、`description`、`canonical`、`og:type` 等会在渲染时写入 `<head>`。
|
||||
SEO / OpenGraph 元数据表(`|键|值|`)。如 `title`、`description`、`canonical`、`og:type` 等会在渲染时写入 `<head>`。特殊键 `icon` / `favicon` / `apple-touch-icon` 会写成 `<link rel="…">`(不会误写成 `<meta name>`)。
|
||||
|
||||
**> web_page_meta page=`self` meta=`元数据`**
|
||||
|
||||
## 头装配
|
||||
+ `表`
|
||||
|
||||
把 Head 资源表(`|关系|地址|类型|尺寸|媒体|作为|跨域|`)挂到页面的 `head`。`关系=script` / `module` 生成 `<script>`,其余生成 `<link>`。与已有 `head` 合并。
|
||||
|
||||
**> web_page_head page=`self` table=`表`**
|
||||
|
||||
## 图片装配
|
||||
+ `表`
|
||||
|
||||
把图片表装配为 HTML,写入 `images_html`(渲染时插在主区引言之前)。表形与模块级 `网页.图片装配` 相同。
|
||||
|
||||
**> web_page_images page=`self` table=`表`**
|
||||
|
||||
## 分页
|
||||
+ `偏移`=0
|
||||
+ `上限`=10
|
||||
@@ -411,10 +443,17 @@ SEO / OpenGraph 元数据表(`|键|值|`)。如 `title`、`description`、`c
|
||||
+ `目录`
|
||||
+ `挂载`=/static
|
||||
|
||||
将 `目录` 下的文件挂到 `挂载`(默认 `/static`)。路径在 `监听` 时相对进程工作目录解析。
|
||||
将 `目录` 下的文件挂到 `挂载`(默认 `/static`)。路径在 `监听` 时相对进程工作目录解析。若目录内有 `favicon.ico` / `favicon.png` / `favicon.svg` 且未配置 `图标`,则额外提供 `GET /favicon.ico` 并为每页注入默认 `<link rel="icon">`。
|
||||
|
||||
**> web_app_static app=`self` dir=`目录` mount=`挂载`**
|
||||
|
||||
## 图标
|
||||
+ `表`
|
||||
|
||||
用 GFM 表注册站点图标(`|路径|关系|类型|尺寸|地址|`)。`监听` 时按 `地址` 提供文件(`.ico` 默认 `/favicon.ico`,否则 `/icons/{文件名}`),并通过 `site_head` 向全站页面注入对应 `<link>`。设计见 [web-assets-and-images.md](../../doc/design/web-assets-and-images.md)。
|
||||
|
||||
**> web_app_icons app=`self` table=`表`**
|
||||
|
||||
## 装配
|
||||
+ `跨域`=None
|
||||
+ `安全`=None
|
||||
|
||||
Reference in new issue
Block a user