How to Add Articles
Overview
Section titled “Overview”This guide explains how to add new articles to the Industrial Docs documentation center.
Directory Structure
Section titled “Directory Structure”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/Steps to Add New Articles
Section titled “Steps to Add New Articles”1. Create a Markdown File
Section titled “1. Create a Markdown File”Create a new .md or .mdx file in the appropriate directory.
# Example: Create a new guide articletouch src/content/docs/guides/my-new-article.md2. Write Frontmatter
Section titled “2. Write Frontmatter”Each document file needs frontmatter at the top:
---title: Article Titledescription: Article description (shown in search results)---3. Write Content
Section titled “3. Write Content”Write your documentation content using Markdown syntax.
## Heading
This is the body content.
### Subheading
- List item 1- List item 24. Add English Version
Section titled “4. Add English Version”Create the corresponding English article in the en directory:
# Example: Create English version for the new articletouch src/content/docs/en/guides/my-new-article.md5. Verify
Section titled “5. Verify”Run the build command to verify:
npm run buildStarlight Components
Section titled “Starlight Components”You can use Starlight’s built-in components to enhance your documentation:
Asides
Section titled “Asides”:::tipThis is a tip:::
:::noteThis is a note:::
:::cautionThis is a caution:::Code Blocks
Section titled “Code Blocks”\`\`\`javascriptconsole.log('Hello World');\`\`\`import { Card, CardGrid } from '@astrojs/starlight/components';
<CardGrid> <Card title="Title">Content</Card></CardGrid>- Use hyphens
-to separate words in filenames titleanddescriptionin frontmatter are required- It is recommended to create English versions for each Chinese article
- Keep the paths consistent between Chinese and English articles