跳转到内容
搜索文档

横幅

最后更新 查看 MarkdownAgent 设置

您可以添加到 Frontmatter 中的字段之一是 banner。它在页面顶部显示一个醒目的区块,并支持使用 HTML 进行链接和格式化。

仅在需要警示破坏性情况时使用它,并注意在适用时将其移除。

示例

---
title: Banner
description: How to display a banner at the top of the page and when to use it.
banner:
  content: Do <strong>not</strong> use banners in the <a href="/style-guide/frontmatter/">Frontmatter</a> unless a change will cause customer application to break.
---

样式 / 类型

Note(注意)

Note横幅用于提示重要信息。

---
title: Banner
description: How to display a banner at the top of the page and when to use it.
banner:
  content: Ensure you read this!
  type: note
---

Tip(提示)

Tip横幅用于提示重要建议。

---
title: Banner
description: How to display a banner at the top of the page and when to use it.
banner:
  content: Consider this alternative!
  type: tip
---

Caution(警告)

Caution横幅用于警告读者即将发生的破坏性变化。

---
title: Banner
description: How to display a banner at the top of the page and when to use it.
banner:
  content: This is deprecated and will break on <strong>1970-01-01</strong>!
  type: caution
---

Danger(危险)

Danger横幅用于警告错误。

---
title: Banner
description: How to display a banner at the top of the page and when to use it.
banner:
  content: This has been removed!
  type: danger
---

Default(默认)

在所有其他情况下使用默认横幅。

---
title: Banner
description: How to display a banner at the top of the page and when to use it.
banner:
  content: Do <strong>not</strong> use banners in the <a href="/style-guide/frontmatter/">Frontmatter</a> unless a change will cause customer application to break.
---

这篇文档对您有帮助吗?