391 字
2 分钟
content-annotations

content-annotations把支撑性的上下文放在句子附近,又不把它直接放进阅读流中。点击小注释标记即可展开其内容。

基本语法#

在普通正文中添加 [+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 会预先渲染页面的大部分内容,并仅在交互式孤岛 需要变为交互时才为其注水。

富文本内容#

定义中可以包含段落、强调、链接、列表和行内代码 ,而周围的句子照常继续。

多个定义#

重复使用同一个标签 ,在一个标记后呈现一组相关的简短注释。

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

content-annotations
https://xiaomai.l.cd/posts/内容注释/
作者
XiaoMai
发布于
2026-08-27
许可协议
CC BY-NC-SA 4.0

分享文章

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

继续阅读

沿着主题读

基于共同的标签与分类

换条路线

从其他文章中稳定抽取