104 字
1 分钟
Markdown 文件引用

在文章中使用引用注释,可以在构建时插入本地 Markdown 文件、指定行或命名片段,避免重复维护相同内容。

原版技术参考与完整示例(英文)

Shirone can include a local Markdown file or a safe slice of one.

export function greet(name: string) {
return `Hello, ${name}`;
}

The full file and line-range forms are also supported:

src/content/snippets/include-example.md
<!-- @include: src/content/snippets/include-example.md{1-4} -->
<!-- @include: src/content/snippets/include-example.md{5-} -->
<!-- @include: src/content/snippets/include-example.md{-4} -->

Include comments inside fenced code remain literal.

Markdown 文件引用
https://sheeqi.com/posts/markdown-includes/
作者
Sheeqi
发布于
2026-08-28
许可协议
CC BY-NC-SA 4.0

分享文章

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

继续阅读

沿着主题读

基于共同的标签与分类

换条路线

从其他文章中稳定抽取