skip to content
swtywang's wiki

astro-post基础使用总结

/ 2 min read

Table of Contents

1. post顶部配置项

  1. title: 文章标题
  2. description: 文章描述
  3. publishDate: 发布时间
  4. updatedDate: 更新时间
  5. tags: 文章标签
  6. draft: 是否为草稿状态
  7. pinned: 是否置顶
  8. coverImage: 封面设置

示例:

Terminal window
title: "Markdown Admonitions"
description: "This post showcases using the markdown admonition feature in Astro Cactus"
publishDate: "25 Aug 2024"
updatedDate: "4 July 2025"
tags: ["markdown", "admonitions", "dota2"]
pinned: true
draft: true
coverImage:
src: "./cover.png"
alt: "Astro build wallpaper"

2. markdown功能

2.1 完整功能

参考A post of Markdown elements

2.2 提示

目前支持以下五类提示类型:

  • note
  • tip
  • important
  • warning
  • caution

示例

Note

:::note
Highlights information that users should take into account, even when skimming.
:::

Tip

:::tip
Optional information to help a user be more successful.
:::

Important

:::important
Crucial information necessary for users to succeed.
:::

Caution

:::caution
Negative potential consequences of an action.
:::

Warning

:::warning
Critical content demanding immediate user attention due to potential risks.
:::

Customising the admonition title

You can customise the admonition title using the following markup:

:::note[My custom title]
This is a note with a custom title.
:::

Outputs: