Posts Article
About 342 words
Overview
Applicable to articles with collection type set to 'post'.
Example:
---
title: Article Title
tags:
- tag1
- tag2
---Configuration
sticky
- Type:
boolean | number - Default:
false
Whether to pin the current article to the top in article lists.
If a number is provided, a higher value will position the article closer to the top when pinned. true ranks above any number, while 0, negative numbers and false are all treated as "not sticky".
Tips
Sticky articles are only pinned on the first page of the article list. From the second page onward, articles are shown in the normal chronological order.
article
- Type:
boolean - Default:
true
Whether to display the current article in article lists.
draft
- Type:
boolean - Default:
false
Marks the article as a draft. Articles marked as drafts only appear in article lists during development and are hidden in production environments.
tags
- Type:
string[] - Default:
[]
Article tags.
cover
- Type:
string - Default:
''
Article cover image. The cover image is only displayed on the article list page.
Only absolute paths and remote image URLs are supported.
coverStyle
- Type:
PostsCoverStyle - Default:
undefined
Cover image configuration.
type PostsCoverLayout = 'left' | 'right' | 'odd-left' | 'odd-right' | 'top'
interface PostsCoverStyle {
/**
* Layout position of the blog post cover image
*/
layout?: PostsCoverLayout
/**
* Aspect ratio of the blog post cover image
*
* @default '4:3'
*/
ratio?: number | `${number}:${number}` | `${number}/${number}`
/**
* Width of the cover image, only effective when layout is 'left' or 'right'
*
* @default 240
*/
width?: number
/**
* Whether to use compact mode. In compact mode, the cover image fits snugly against the container edge.
* @default false
*/
compact?: boolean
}excerpt
- Type:
boolean | string - Default:
undefined
Whether to display the article excerpt. When a string is passed, it is used as a custom excerpt, and the <!-- more --> comment is ignored.
Other fields of the article frontmatter
createTime: Creation time, see Basic frontmatterpassword/passwordHint: Article encryption, see Encryptioncopyright: Copyright information, see Copyright
