Article Publishing Guide

Sep 29, 2025

Creating Article Files

First, create a new folder under the src/content/blog/ directory. You can create it directly within this directory or nest it within subdirectories.

For example, create a folder named src/content/blog/my-first-post/, or create src/content/blog/posts/my-first-post/ within a subdirectory. Your article will be published to the corresponding route based on the file’s relative path (relative to src/content/), such as /blog/my-first-post.

For internationalization, use <language>.md naming conventions to distinguish articles in different languages. For example, src/content/blog/my-first-post/zh-cn.md and src/content/blog/my-first-post/en.md represent the Chinese and English versions of an article, respectively.

IMPORTANT
  • A default language version must exist. When generating pages, if a language version is missing for the current article, the default language version will be used as the article content.
  • The languages used must be configured in astro.config.mjs.

Writing Article Metadata

Each article requires a metadata section (frontmatter) using YAML format, enclosed by --- as shown below:

---
title: Article Title
pubDate: 2025-01-01
description: Brief article description
image: ""
draft: false
slugId: intro/publish
---
NameFunction
titleArticle title
pubDatePublication date, formatted as YYYY-MM-DD
descriptionArticle description
imageCover image, using relative paths relative to the current file, e.g., ./images/cover.png
draftDraft status; articles in draft mode won’t appear on the blog homepage when published
slugIdArticle ID, used for generating routes. Each article must be unique. It is recommended to use article paths, such as intro/publish.

Writing Article Content

Article content can be written using Markdown format, supporting specific syntax. Refer to other sample articles for details.

Special Pages

For example, the About page is stored in the src/content/spec/about/ folder. Similar to articles, it supports multiple languages and is written in Markdown. It will be rendered according to Markdown formatting and published to the /about route.

Article Publishing Guide
https://momo.motues.top/en/blog/intro/publish-blog/
Author
Momo
Published on
Sep 29, 2025
License
CC BY-NC-SA 4.0

Loading comments...

Enter keywords to start searching