Skip to content

Commit ed927d4

Browse files
committed
product versions added to header
1 parent 4078018 commit ed927d4

File tree

15 files changed

+1358
-438
lines changed

15 files changed

+1358
-438
lines changed

.claude/commands/add-version.md

Lines changed: 248 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,100 @@
11
# Add New Version to Existing Product
22

3-
This command helps you quickly add a new version to an existing product in the documentation.
3+
This command helps you quickly add a new version to an existing product in the Netwrix documentation site built on Docusaurus v3.
44

5-
## Steps to Complete
5+
## Quick Reference
66

7-
1. **Gather Information**
8-
- Ask user for product name (e.g., "accessanalyzer", "threatprevention")
9-
- Ask for new version number (e.g., "12.1", "7.6")
10-
- Identify the current latest version by checking existing directories
7+
**Command Pattern**: `npm start {productname}/{new_version}` to test
8+
**Key Files**:
9+
- `/docs/{productname}/{version}/` - Documentation files
10+
- `/sidebars/{productname}/{version}.js` - Sidebar configuration
11+
- `docusaurus.config.js` - Plugin configuration
12+
- `/src/components/HomepageFeatures/index.js` - Version badges
13+
- `/static/img/product_docs/{productname}/{version}/` - Images
1114

12-
2. **Copy Documentation from Latest Version**
15+
---
16+
17+
## Complete Step-by-Step Process
18+
19+
### 1. **Gather Information & Validate**
20+
21+
**Ask user for:**
22+
- Product name (e.g., "accessanalyzer", "identitymanager")
23+
- New version number (e.g., "12.1", "6.3")
24+
25+
**Validate existing structure:**
1326
```bash
14-
# Find latest version
15-
ls -d /docs/{productname}/*/ | sort -V | tail -1
27+
# Check existing versions
28+
ls -d docs/{productname}/*/ | sort -V
1629

17-
# Copy to new version
18-
cp -r /docs/{productname}/{latest_version}/ /docs/{productname}/{new_version}/
30+
# Verify latest version
31+
ls -d docs/{productname}/*/ | sort -V | tail -1
1932
```
2033

21-
3. **Update Frontmatter in Copied Files**
22-
- Update version references in all `.md` files
23-
- Update any version-specific content in whatsnew.md
34+
### 2. **Create Documentation Directory**
35+
36+
**Create new version directory:**
37+
```bash
38+
# Create new version directory structure
39+
mkdir -p docs/{productname}/{new_version}
40+
41+
# Create basic index.md file
42+
cat > docs/{productname}/{new_version}/index.md << 'EOF'
43+
---
44+
title: '{Product Name} {new_version}'
45+
sidebar_label: "What's New"
46+
description: '{Product Name} {new_version} documentation'
47+
---
48+
49+
# {Product Name} {new_version}
2450
25-
4. **Create New Sidebar Configuration**
51+
* content to be added *
52+
EOF
53+
```
54+
55+
**Verify directory created:**
2656
```bash
27-
cp /sidebars/{productname}-{latest_version}-sidebar.js /sidebars/{productname}-{new_version}-sidebar.js
57+
ls -la docs/{productname}/{new_version}/
2858
```
59+
60+
### 3. **Create Image Directory**
2961

30-
Update the sidebar file if it contains version-specific paths.
62+
```bash
63+
# Create version-specific image directory
64+
mkdir -p static/img/product_docs/{productname}/{new_version}
65+
```
3166

32-
5. **Add to docusaurus.config.js**
67+
### 4. **Create Sidebar Configuration**
68+
69+
**Set up sidebar directory structure:**
70+
```bash
71+
# Create sidebar directory if it doesn't exist
72+
mkdir -p sidebars/{productname}
73+
74+
# Create new sidebar configuration file
75+
cat > sidebars/{productname}/{new_version}.js << 'EOF'
76+
module.exports = {
77+
productSidebar: [
78+
{
79+
type: 'autogenerated',
80+
dirName: '.',
81+
},
82+
],
83+
};
84+
EOF
85+
```
86+
87+
### 5. **Add Docusaurus Plugin Configuration**
3388

34-
Add new plugin configuration after the existing versions:
3589
```javascript
90+
// Add this block AFTER existing versions, before the closing ];
3691
[
3792
'@docusaurus/plugin-content-docs',
3893
{
39-
id: '{productname}{version_underscores}', // e.g., 'accessanalyzer12_1'
94+
id: '{productname}{version_with_underscores}', // e.g., 'accessanalyzer12_1'
4095
path: 'docs/{productname}/{version}',
4196
routeBasePath: 'docs/{productname}/{version}',
42-
sidebarPath: require.resolve('./sidebars/{productname}-{version}-sidebar.js'),
97+
sidebarPath: require.resolve('./sidebars/{productname}/{version}.js'),
4398
editUrl: 'https://github.com/netwrix/docs/tree/main/',
4499
exclude: ['**/CLAUDE.md'],
45100
versions: {
@@ -50,39 +105,189 @@ This command helps you quickly add a new version to an existing product in the d
50105
},
51106
],
52107
```
108+
109+
**Important Notes:**
110+
- Convert dots to underscores in ID: `12.1``12_1`
111+
- Use exact version number in path
112+
- Point to the correct sidebar file
53113

54-
6. **Update HomepageFeatures Component**
114+
### 6. **Update HomepageFeatures Component**
55115

56-
Find the product in `/src/components/HomepageFeatures/index.js` and update the link to point to the new version:
116+
**Update version badges in `/src/components/HomepageFeatures/index.js`:**
117+
118+
Find the product in the appropriate category and update:
57119
```javascript
58120
{
59-
title: '{Product Name}',
60-
link: '/docs/{productname}/{new_version}', // Update to new version
61-
description: '{product description}'
62-
},
121+
name: '{Product Name}',
122+
description: '{product description}',
123+
link: '/docs/{productname}/{new_version}', // ← Update main link
124+
versions: [
125+
{ version: '{new_version}', link: '/docs/{productname}/{new_version}', isLatest: true }, // ← Add new
126+
{ version: '{old_latest}', link: '/docs/{productname}/{old_latest}', isLatest: false }, // ← Update
127+
{ version: '{older_version}', link: '/docs/{productname}/{older_version}', isLatest: false },
128+
// ... other versions
129+
],
130+
}
63131
```
64132

65-
7. **Test the New Version**
133+
### 7. **Test the New Version**
134+
135+
**Start development server:**
66136
```bash
137+
# Test single product mode (recommended)
67138
npm start {productname}/{new_version}
68139
```
140+
141+
---
142+
143+
## Examples
144+
145+
### Example 1: Adding Access Analyzer 12.1
146+
147+
```bash
148+
# 1. Create new documentation directory
149+
mkdir -p docs/accessanalyzer/12.1
150+
# Create index.md with Access Analyzer 12.1 content
151+
152+
# 2. Create images directory
153+
mkdir -p static/img/product_docs/accessanalyzer/12.1
154+
touch static/img/product_docs/accessanalyzer/12.1/.gitkeep
155+
156+
# 3. Create sidebar
157+
mkdir -p sidebars/accessanalyzer
158+
# Create sidebars/accessanalyzer/12.1.js with standard structure
159+
160+
# 4. Update docusaurus.config.js - Add plugin with ID: 'accessanalyzer12_1'
161+
162+
# 5. Update HomepageFeatures - Change link to '/docs/accessanalyzer/12.1'
163+
164+
# 6. Test
165+
npm start accessanalyzer/12.1
166+
```
167+
168+
### Example 2: Adding Identity Manager 6.3
169+
170+
```bash
171+
# 1. Create new documentation directory
172+
mkdir -p docs/identitymanager/6.3
173+
# Create index.md with Identity Manager 6.3 content
174+
175+
# 2. Create images directory
176+
mkdir -p static/img/product_docs/identitymanager/6.3
177+
touch static/img/product_docs/identitymanager/6.3/.gitkeep
178+
179+
# 3. Create sidebar
180+
mkdir -p sidebars/identitymanager
181+
# Create sidebars/identitymanager/6.3.js with standard structure
182+
183+
# 4. Update docusaurus.config.js - Add plugin with ID: 'identitymanager6_3'
184+
185+
# 5. Update HomepageFeatures - Change link to '/docs/identitymanager/6.3'
186+
187+
# 6. Test
188+
npm start identitymanager/6.3
189+
```
190+
191+
---
192+
193+
## Configuration Patterns
194+
195+
### Plugin ID Naming Convention
196+
- **Dots to underscores**: `12.1``12_1`
197+
- **Pattern**: `{productname}{version_underscores}`
198+
- **Examples**:
199+
- `accessanalyzer12_1`
200+
- `identitymanager6_3`
201+
- `endpointprotector5_9_4_3`
202+
203+
### Sidebar File Patterns
204+
- **Standard**: `./sidebars/{productname}/{version}.js`
205+
- **Generic fallback**: `./sidebars/sidebar.js`
206+
- **Legacy pattern**: `./sidebars/{productname}-{version}-sidebar.js` (still supported)
207+
208+
### Version Badge System
209+
- **Latest version**: Green badge with `isLatest: true`
210+
- **Older versions**: Blue badges with `isLatest: false`
211+
- **Display format**: "v{version}" (e.g., "v12.1")
212+
213+
---
214+
215+
## Important Reminders
216+
217+
### Before You Start
218+
- ✅ Use single-product mode: `npm start {productname}/{version}` for faster development
219+
- ✅ Create fresh documentation structure for the new version
220+
- ✅ Create version-specific image directories
221+
- ✅ Test thoroughly before committing
222+
223+
### Configuration Rules
224+
- ✅ Version dots → underscores in plugin IDs
225+
- ✅ Always exclude `['**/CLAUDE.md']` in plugin config
226+
- ✅ Update main link AND versions array in HomepageFeatures
227+
- ✅ Use `.webp` format for images when possible
228+
229+
### Quality Assurance
230+
- ✅ Run `npm run format` before committing
231+
- ✅ Test dark mode appearance
232+
- ✅ Verify all navigation links work
233+
- ✅ Check version badges display correctly
234+
- ✅ Ensure images load from correct directories
235+
236+
### Common Issues
237+
- 🚫 **Port conflicts**: Default runs on port 3000
238+
- 🚫 **Memory issues**: Already configured with 8GB limit
239+
- 🚫 **Cache problems**: Run `npm run clear` to reset
240+
- 🚫 **Hot reload failure**: Restart dev server
241+
- 🚫 **Missing images**: Check image directory paths match version
242+
243+
---
244+
245+
## Troubleshooting
246+
247+
### Build Failures
248+
```bash
249+
# Clear all caches
250+
npm run clear
251+
rm -rf .docusaurus
252+
253+
# Restart with fresh cache
254+
npm start {productname}/{version}
255+
```
256+
257+
### Missing Sidebar
258+
```bash
259+
# Check if sidebar file exists
260+
ls -la sidebars/{productname}/{version}.js
261+
262+
# Copy from generic if missing
263+
cp sidebars/sidebar.js sidebars/{productname}/{version}.js
264+
```
265+
266+
### Image Not Loading
267+
```bash
268+
# Verify image directory exists
269+
ls -la static/img/product_docs/{productname}/{version}/
270+
271+
# Check image paths in markdown (should be absolute)
272+
grep -r "img/product_docs" docs/{productname}/{version}/
273+
```
274+
275+
### Version Badge Not Showing
276+
- Verify `versions` array in HomepageFeatures includes new version
277+
- Check `isLatest: true` is set only for the newest version
278+
- Ensure main `link` property points to latest version
69279

70-
8. **Update What's New Page**
71-
- Clear the content in `/docs/{productname}/{new_version}/whatsnew.md`
72-
- Add placeholder for new version features
280+
---
73281

74-
## Example
282+
## Files Modified Checklist
75283

76-
Adding version 12.1 to Access Analyzer:
77-
1. Copy from 12.0: `cp -r docs/accessanalyzer/12.0/ docs/accessanalyzer/12.1/`
78-
2. Create sidebar: `cp sidebars/accessanalyzer-12.0-sidebar.js sidebars/accessanalyzer-12.1-sidebar.js`
79-
3. Add plugin with id: `accessanalyzer12_1`
80-
4. Update HomepageFeatures link to `/docs/accessanalyzer/12.1`
81-
5. Test: `npm start accessanalyzer/12.1`
284+
When complete, you should have modified:
82285

83-
## Important Notes
286+
- [ ] `/docs/{productname}/{new_version}/` - New documentation directory
287+
- [ ] `/static/img/product_docs/{productname}/{new_version}/` - New images directory
288+
- [ ] `/sidebars/{productname}/{new_version}.js` - New sidebar configuration
289+
- [ ] `docusaurus.config.js` - Added new plugin configuration
290+
- [ ] `/src/components/HomepageFeatures/index.js` - Updated version badges
291+
- [ ] `/docs/{productname}/{new_version}/whatsnew.md` - Created for new content
84292

85-
- Version numbers use dots in paths (12.1) but underscores in IDs (12_1)
86-
- Always test the new version before committing
87-
- Update whatsnew.md with actual changes for the new version
88-
- Consider if any version-specific content needs updating
293+
**Test command**: `npm start {productname}/{new_version}`

0 commit comments

Comments
 (0)