418 字
2 分钟
内容标注

内容标注把补充性说明贴近某一句话,却又不直接插入阅读主线。点击小小的注释标记即可展开其中的内容。

基本语法#

在普通行文中添加一个 [+label] 引用,然后在同一篇文章的别处定义与之匹配的注释。

Astro renders most of a page ahead of time and hydrates **interactive islands** [+islands] only when they need to become interactive.
[+islands]:
An island is an interactive UI component surrounded by static HTML. This keeps the default page lightweight while preserving focused interactivity.

Astro 会在构建阶段预先渲染页面的大部分内容,并且只在需要交互时才水合这些交互式岛屿(interactive islands)

富内容#

定义里可以包含段落、强调、链接、列表与行内代码 ,而周围的句子仍能正常继续。

多重定义#

可以重复使用同一个标签 ,把一小组相关的注释呈现在同一个标记之后。

未定义的引用(如 [+missing])会保持为普通文本,因此未完成的定义永远不会产生一个空控件。

内容标注
https://shirone.mysqil.com/posts/content-annotations/
作者
Znfooe
发布于
2026-08-27
许可协议
CC BY-NC-SA 4.0

分享文章

生成精美分享图或复制链接,与更多人分享本文。

继续阅读

沿着主题读

基于共同的标签与分类

换条路线

从其他文章中稳定抽取