Skip to content

How to Add Articles

This guide explains how to add new articles to the Industrial Docs documentation center.

src/content/docs/
├── index.mdx # Home page
├── guides/ # Guides directory
│ └── getting-started.md
├── best-practices/ # Best Practices directory
│ └── getting-started.md
└── en/ # English version
├── index.mdx
├── guides/
└── best-practices/

Create a new .md or .mdx file in the appropriate directory.

Terminal window
# Example: Create a new guide article
touch src/content/docs/guides/my-new-article.md

Each document file needs frontmatter at the top:

---
title: Article Title
description: Article description (shown in search results)
---

Write your documentation content using Markdown syntax.

## Heading
This is the body content.
### Subheading
- List item 1
- List item 2

Create the corresponding English article in the en directory:

Terminal window
# Example: Create English version for the new article
touch src/content/docs/en/guides/my-new-article.md

Run the build command to verify:

Terminal window
npm run build

You can use Starlight’s built-in components to enhance your documentation:

:::tip
This is a tip
:::
:::note
This is a note
:::
:::caution
This is a caution
:::
\`\`\`javascript
console.log('Hello World');
\`\`\`
import { Card, CardGrid } from '@astrojs/starlight/components';
<CardGrid>
<Card title="Title">Content</Card>
</CardGrid>
  • Use hyphens - to separate words in filenames
  • title and description in frontmatter are required
  • It is recommended to create English versions for each Chinese article
  • Keep the paths consistent between Chinese and English articles