Skip to content

Commit 3760eaf

Browse files
committed
early access build
1 parent 9e17719 commit 3760eaf

File tree

115 files changed

+1835
-1558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+1835
-1558
lines changed

README.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,137 @@ The deployment process runs `npm run build` and serves the generated static file
133133
- **Memory allocation**: Increased to 8GB for large documentation builds
134134
- **Browser support**: Modern browsers (see `browserslist` in package.json)
135135
136+
## Homepage Maintenance Guide
137+
138+
The homepage features several dynamic components that can be easily customized. Here's how to maintain and update them:
139+
140+
### Adding New Products to the Homepage
141+
142+
Products are organized into categories and displayed on the homepage. To add a new product:
143+
144+
1. **Navigate to**: `src/components/HomepageFeatures/index.js`
145+
2. **Find the `ProductCategories` array** (around line 39)
146+
3. **Choose the appropriate category** or create a new one
147+
4. **Add your product** following this structure:
148+
```javascript
149+
{
150+
name: 'Product Name',
151+
description: 'Brief description of what the product does',
152+
link: '/docs/productname', // Must match your docs folder
153+
}
154+
```
155+
156+
**Example - Adding a new product to Security Administration:**
157+
```javascript
158+
{
159+
name: 'New Security Tool',
160+
description: 'Advanced threat detection and response',
161+
link: '/docs/newsecuritytool',
162+
}
163+
```
164+
165+
**To create a new category:**
166+
```javascript
167+
{
168+
title: 'New Category Name',
169+
description: 'Category description',
170+
icon: '🔒', // Choose an appropriate emoji
171+
products: [
172+
// Add products here
173+
],
174+
}
175+
```
176+
177+
### Customizing the Animated Title
178+
179+
The homepage features a typewriter effect with rotating titles. To customize:
180+
181+
1. **Navigate to**: `src/components/HomepageFeatures/index.js`
182+
2. **Find the `SECTION_TITLES` array** (around line 15)
183+
3. **Add/remove/edit titles** as needed:
184+
```javascript
185+
const SECTION_TITLES = [
186+
"Your New Title Here",
187+
"Another Creative Title",
188+
"Mix Professional and Fun Titles",
189+
]
190+
```
191+
192+
**Animation settings:**
193+
- Type speed: 60ms per character
194+
- Backspace speed: 30ms per character
195+
- Pause duration: 2 seconds between titles
196+
- Loops infinitely with a blinking cursor
197+
198+
### Managing Community Topics
199+
200+
The community carousel fetches live data from Discourse but can be customized:
201+
202+
#### Changing Topic Selection Criteria
203+
204+
1. **Navigate to**: `src/components/CommunityHighlights/index.js`
205+
2. **Find the engagement scoring logic** (around line 110):
206+
```javascript
207+
const scoreA = (a.like_count || 0) * 10 + (a.views || 0) * 0.1 + (a.posts_count || 0) * 2
208+
```
209+
3. **Adjust the multipliers** to change topic prioritization:
210+
- `likes × 10`: High weight for liked topics
211+
- `views × 0.1`: Low weight for view count
212+
- `posts × 2`: Medium weight for discussion activity
213+
214+
#### Adding New Product Tags
215+
216+
To recognize new products in community topics:
217+
218+
1. **Navigate to**: `src/components/CommunityHighlights/index.js`
219+
2. **Find the `PRODUCT_TAGS` array** (around line 13)
220+
3. **Add new tags** in lowercase, hyphenated format:
221+
```javascript
222+
const PRODUCT_TAGS = [
223+
// existing tags...
224+
'new-product-name',
225+
'another-product',
226+
]
227+
```
228+
229+
#### Customizing Carousel Behavior
230+
231+
**Timing settings** (around line 158):
232+
- `delay: 10000`: 10 seconds between slides
233+
- `speed: 800`: 1.8 seconds for slide transition
234+
235+
**To change these:**
236+
```javascript
237+
const interval = setInterval(() => {
238+
// Change slide logic
239+
}, 10000) // Change this number (milliseconds)
240+
```
241+
242+
**Transition speed** in CSS (`src/components/CommunityHighlights/styles.module.css`):
243+
```css
244+
.carouselTrack {
245+
transition: transform 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
246+
}
247+
```
248+
249+
### Other Customizations
250+
251+
#### Updating the Hero Section
252+
253+
1. **Navigate to**: `src/pages/index.js`
254+
2. **Find the `HomepageHeader` function** (around line 10)
255+
3. **Update title, subtitle, or button text**:
256+
```javascript
257+
<h1 className={styles.heroTitle}>Your New Title</h1>
258+
<p className={styles.heroSubtitle}>Your new subtitle</p>
259+
```
260+
261+
#### Styling Changes
262+
263+
- **Global styles**: `src/css/custom.css`
264+
- **Component styles**: Each component has its own `.module.css` file
265+
- **Homepage styles**: `src/pages/index.module.css`
266+
136267
## Contributing
137268

138269
1. Make changes to the appropriate documentation files

build-product.js

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,93 @@
11
#!/usr/bin/env node
22
// Script to build individual products for testing
33

4-
const fs = require('fs')
5-
const path = require('path')
6-
const { execSync } = require('child_process')
4+
const fs = require('fs');
5+
const path = require('path');
6+
const { execSync } = require('child_process');
77

8-
const productsConfigPath = path.join(__dirname, 'docusaurus.config.products.js')
8+
const productsConfigPath = path.join(__dirname, 'docusaurus.config.products.js');
99

1010
// Get product name from command line
11-
const product = process.argv[2]
11+
const product = process.argv[2];
1212

1313
if (!product) {
14-
console.log('Usage: node build-product.js <product-name>')
15-
console.log('Available products:')
16-
console.log(' - 1secure')
17-
console.log(' - accessanalyzer')
18-
console.log(' - accessinformationcenter')
19-
console.log(' - activitymonitor')
20-
console.log(' - auditor')
21-
console.log(' - changetracker')
22-
console.log(' - dataclassification')
23-
console.log(' - endpointprotector')
24-
console.log(' - groupid')
25-
console.log(' - passwordpolicyenforcer')
26-
console.log(' - passwordreset')
27-
console.log(' - passwordsecure')
28-
console.log(' - policypak')
29-
console.log(' - privilegesecure')
30-
console.log(' - recoveryforactivedirectory')
31-
console.log(' - strongpointfornetsuite')
32-
console.log(' - strongpointforsalesforce')
33-
console.log(' - strongpointnetsuiteflashlight')
34-
console.log(' - strongpointsalesforceflashlight')
35-
console.log(' - threatmanager')
36-
console.log(' - threatprevention')
37-
console.log(' - usercube')
38-
console.log(' - usercube_saas')
39-
process.exit(1)
14+
console.log('Usage: node build-product.js <product-name>');
15+
console.log('Available products:');
16+
console.log(' - 1secure');
17+
console.log(' - accessanalyzer');
18+
console.log(' - accessinformationcenter');
19+
console.log(' - activitymonitor');
20+
console.log(' - auditor');
21+
console.log(' - changetracker');
22+
console.log(' - dataclassification');
23+
console.log(' - endpointprotector');
24+
console.log(' - groupid');
25+
console.log(' - passwordpolicyenforcer');
26+
console.log(' - passwordreset');
27+
console.log(' - passwordsecure');
28+
console.log(' - policypak');
29+
console.log(' - privilegesecure');
30+
console.log(' - recoveryforactivedirectory');
31+
console.log(' - strongpointfornetsuite');
32+
console.log(' - strongpointforsalesforce');
33+
console.log(' - strongpointnetsuiteflashlight');
34+
console.log(' - strongpointsalesforceflashlight');
35+
console.log(' - threatmanager');
36+
console.log(' - threatprevention');
37+
console.log(' - usercube');
38+
console.log(' - usercube_saas');
39+
process.exit(1);
4040
}
4141

4242
// Read the products config file
43-
let configContent = fs.readFileSync(productsConfigPath, 'utf8')
43+
let configContent = fs.readFileSync(productsConfigPath, 'utf8');
4444

4545
// Update the PRODUCTS object to enable only the selected product
46-
const productsRegex = /const PRODUCTS = {[\s\S]*?};?/ // Added ? to make semicolon optional
47-
const currentProducts = configContent.match(productsRegex)[0]
46+
const productsRegex = /const PRODUCTS = {[\s\S]*?};?/; // Added ? to make semicolon optional
47+
const currentProducts = configContent.match(productsRegex)[0];
4848

4949
// Parse the current state
50-
const productStates = {}
51-
const lines = currentProducts.split('\n')
50+
const productStates = {};
51+
const lines = currentProducts.split('\n');
5252
lines.forEach((line) => {
53-
const match = line.match(/^\s*['"]?([^'"]+)['"]?:\s*(true|false),?$/)
53+
const match = line.match(/^\s*['"]?([^'"]+)['"]?:\s*(true|false),?$/);
5454
if (match) {
55-
productStates[match[1]] = false // Set all to false
55+
productStates[match[1]] = false; // Set all to false
5656
}
57-
})
57+
});
5858

5959
// Enable only the selected product
6060
if (productStates.hasOwnProperty(product)) {
61-
productStates[product] = true
61+
productStates[product] = true;
6262
} else {
63-
console.error(`Error: Product '${product}' not found!`)
64-
process.exit(1)
63+
console.error(`Error: Product '${product}' not found!`);
64+
process.exit(1);
6565
}
6666

6767
// Build the new PRODUCTS object
68-
let newProductsObj = 'const PRODUCTS = {\n'
68+
let newProductsObj = 'const PRODUCTS = {\n';
6969
Object.entries(productStates).forEach(([name, enabled]) => {
70-
newProductsObj += ` '${name}': ${enabled},\n`
71-
})
72-
newProductsObj += '};'
70+
newProductsObj += ` '${name}': ${enabled},\n`;
71+
});
72+
newProductsObj += '};';
7373

7474
// Replace in the config
75-
configContent = configContent.replace(productsRegex, newProductsObj)
75+
configContent = configContent.replace(productsRegex, newProductsObj);
7676

7777
// Write back the updated config
78-
fs.writeFileSync(productsConfigPath, configContent)
78+
fs.writeFileSync(productsConfigPath, configContent);
7979

80-
console.log(`\nBuilding documentation for: ${product}`)
81-
console.log('This will show only errors specific to this product.\n')
80+
console.log(`\nBuilding documentation for: ${product}`);
81+
console.log('This will show only errors specific to this product.\n');
8282

8383
try {
8484
// Run the build with the modular config
8585
execSync('npm run build -- --config ./docusaurus.config.modular.js', {
8686
stdio: 'inherit',
8787
cwd: __dirname,
88-
})
89-
console.log(`\n✅ Build completed successfully for ${product}!`)
88+
});
89+
console.log(`\n✅ Build completed successfully for ${product}!`);
9090
} catch (error) {
91-
console.log(`\n❌ Build failed for ${product}. Check the errors above.`)
92-
process.exit(1)
91+
console.log(`\n❌ Build failed for ${product}. Check the errors above.`);
92+
process.exit(1);
9393
}

docusaurus.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// There are various equivalent ways to declare your Docusaurus config.
55
// See: https://docusaurus.io/docs/api/docusaurus-config
66

7-
import { themes as prismThemes } from 'prism-react-renderer'
7+
import { themes as prismThemes } from 'prism-react-renderer';
88

99
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
1010

@@ -645,6 +645,6 @@ const config = {
645645
stylesheets: [
646646
'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap',
647647
],
648-
}
648+
};
649649

650-
export default config
650+
export default config;

docusaurus.config.modular.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// @ts-check
22
// Modular Docusaurus configuration for testing individual products
33

4-
import { themes as prismThemes } from 'prism-react-renderer'
5-
const { getEnabledPlugins, getEnabledNavItems } = require('./docusaurus.config.products')
4+
import { themes as prismThemes } from 'prism-react-renderer';
5+
const { getEnabledPlugins, getEnabledNavItems } = require('./docusaurus.config.products');
66

77
/** @type {import('@docusaurus/types').Config} */
88
const config = {
@@ -79,6 +79,6 @@ const config = {
7979
stylesheets: [
8080
'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap',
8181
],
82-
}
82+
};
8383

84-
export default config
84+
export default config;

docusaurus.config.products.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const PRODUCTS = {
2626
threatprevention: false,
2727
usercube: true,
2828
usercube_saas: false,
29-
}
29+
};
3030

3131
const productConfigs = {
3232
'1secure': {
@@ -190,15 +190,15 @@ const productConfigs = {
190190
sidebarPath: './sidebars/usercube_saas.js',
191191
navLabel: 'UserCube SaaS',
192192
},
193-
}
193+
};
194194

195195
// Generate plugin configurations for enabled products
196196
function getEnabledPlugins() {
197-
const plugins = []
197+
const plugins = [];
198198

199199
Object.entries(PRODUCTS).forEach(([product, enabled]) => {
200200
if (enabled && productConfigs[product]) {
201-
const config = productConfigs[product]
201+
const config = productConfigs[product];
202202
plugins.push([
203203
'@docusaurus/plugin-content-docs',
204204
{
@@ -214,32 +214,32 @@ function getEnabledPlugins() {
214214
},
215215
},
216216
},
217-
])
217+
]);
218218
}
219-
})
219+
});
220220

221-
return plugins
221+
return plugins;
222222
}
223223

224224
// Generate navbar items for enabled products
225225
function getEnabledNavItems() {
226-
const items = []
226+
const items = [];
227227

228228
Object.entries(PRODUCTS).forEach(([product, enabled]) => {
229229
if (enabled && productConfigs[product]) {
230-
const config = productConfigs[product]
230+
const config = productConfigs[product];
231231
items.push({
232232
label: config.navLabel,
233233
to: `/${config.routeBasePath}`,
234-
})
234+
});
235235
}
236-
})
236+
});
237237

238-
return items
238+
return items;
239239
}
240240

241241
module.exports = {
242242
PRODUCTS,
243243
getEnabledPlugins,
244244
getEnabledNavItems,
245-
}
245+
};

0 commit comments

Comments
 (0)