Skip to content

Commit 8663655

Browse files
committed
Improve documentation site user experience and developer workflow
## Features Added - **Copy-to-clipboard functionality**: Added hover-to-reveal copy buttons on code blocks with visual feedback - **Enhanced breadcrumbs navigation**: Improved styling with better visual separation and spacing - **Image optimization**: Implemented lazy loading and responsive images using IdealImage plugin - **Code quality tools**: Set up ESLint and Prettier with project-specific configurations ## Technical Improvements - Added ESLint v9 configuration with Docusaurus-specific rules - Configured Prettier with consistent formatting standards - Swizzled CodeBlock component for enhanced functionality - Created reusable OptimizedImage component with lazy loading - Added MDX component overrides for automatic image optimization - Enhanced breadcrumbs with improved UX styling ## Developer Experience - Added npm scripts for linting and formatting - Automatic code formatting for consistent style - Better build performance with image optimization - Improved accessibility with proper ARIA labels All changes maintain backward compatibility and follow Docusaurus best practices.
1 parent d9da906 commit 8663655

22 files changed

+477
-98
lines changed

.eslintrc.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
const { FlatCompat } = require('@eslint/eslintrc');
2+
const compat = new FlatCompat({
3+
baseDirectory: __dirname,
4+
});
5+
6+
module.exports = [
7+
...compat.extends('@docusaurus/eslint-plugin/recommended'),
8+
{
9+
files: ['src/**/*.{js,jsx,ts,tsx}'],
10+
languageOptions: {
11+
ecmaVersion: 2020,
12+
sourceType: 'module',
13+
parserOptions: {
14+
ecmaFeatures: {
15+
jsx: true,
16+
},
17+
},
18+
globals: {
19+
window: 'readonly',
20+
document: 'readonly',
21+
console: 'readonly',
22+
process: 'readonly',
23+
require: 'readonly',
24+
module: 'readonly',
25+
__dirname: 'readonly',
26+
},
27+
},
28+
rules: {
29+
'react/prop-types': 'off',
30+
'@docusaurus/string-literal-i18n-messages': 'off',
31+
},
32+
},
33+
{
34+
ignores: [
35+
'build/**',
36+
'.docusaurus/**',
37+
'node_modules/**',
38+
],
39+
},
40+
];

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
build
2+
.docusaurus
3+
node_modules
4+
*.md
5+
yarn.lock
6+
package-lock.json

.prettierrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "all",
4+
"singleQuote": true,
5+
"printWidth": 80,
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"bracketSpacing": false,
9+
"arrowParens": "avoid"
10+
}

docs/kb/providers/equinixmetal.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ address information can be found by querying https://metadata.platformequinix.co
5252
from the host.
5353

5454
More information on how Equinix Metal configures bonding can be found
55-
[here](https://metal.equinix.com/developers/docs/networking/layer2/).
55+
[here](https://deploy.equinix.com/developers/docs/metal/layer2-networking/overview/).
5656

5757
Nameservers should be configured as:
5858

5959
```
6060
nameserver 147.75.207.207
6161
nameserver 147.75.207.208
62-
```
62+
```

docusaurus.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module.exports = {
1414
markdown: {
1515
mermaid: true,
1616
},
17+
staticDirectories: ['static'],
1718
themes: ['@docusaurus/theme-mermaid'],
1819
themeConfig: {
1920
metadata: [
@@ -161,6 +162,18 @@ module.exports = {
161162
copyright: `Copyright © ${new Date().getFullYear()} netboot.xyz`,
162163
},
163164
},
165+
plugins: [
166+
[
167+
'@docusaurus/plugin-ideal-image',
168+
{
169+
quality: 70,
170+
max: 1030,
171+
min: 640,
172+
steps: 2,
173+
disableInDev: false,
174+
},
175+
],
176+
],
164177
presets: [
165178
[
166179
"@docusaurus/preset-classic",

package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
"swizzle": "docusaurus swizzle",
1010
"deploy": "docusaurus deploy",
1111
"serve": "docusaurus serve",
12-
"clear": "docusaurus clear"
12+
"clear": "docusaurus clear",
13+
"lint": "eslint src --ext .js,.jsx,.ts,.tsx",
14+
"lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
15+
"format": "prettier --write src/**/*.{js,jsx,ts,tsx,css,md}",
16+
"format:check": "prettier --check src/**/*.{js,jsx,ts,tsx,css,md}"
1317
},
1418
"dependencies": {
1519
"@docusaurus/core": "3.8.1",
@@ -38,5 +42,12 @@
3842
"last 1 firefox version",
3943
"last 1 safari version"
4044
]
45+
},
46+
"devDependencies": {
47+
"@docusaurus/eslint-plugin": "^3.8.1",
48+
"@eslint/eslintrc": "^3.3.1",
49+
"eslint-config-prettier": "^10.1.8",
50+
"eslint-plugin-prettier": "^5.5.4",
51+
"prettier": "^3.6.2"
4152
}
4253
}

src/components/DownloadCard.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,18 @@ const DownloadCard = ({
99
url,
1010
type,
1111
isRecommended = false,
12-
icon
12+
icon,
1313
}) => {
1414
const handleDownload = () => {
1515
window.open(url, '_blank');
1616
};
1717

1818
return (
19-
<div className={clsx(
20-
styles.downloadCard,
21-
isRecommended && styles.recommended
22-
)}>
19+
<div
20+
className={clsx(styles.downloadCard, isRecommended && styles.recommended)}
21+
>
2322
{isRecommended && (
24-
<div className={styles.recommendedBadge}>
25-
Recommended
26-
</div>
23+
<div className={styles.recommendedBadge}>Recommended</div>
2724
)}
2825

2926
<div className={styles.cardHeader}>
@@ -40,7 +37,7 @@ const DownloadCard = ({
4037
aria-label={`Download ${title}`}
4138
>
4239
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor">
43-
<path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"/>
40+
<path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z" />
4441
</svg>
4542
Download
4643
</button>
@@ -53,7 +50,7 @@ DownloadCard.propTypes = {
5350
url: PropTypes.string.isRequired,
5451
type: PropTypes.string.isRequired,
5552
isRecommended: PropTypes.bool,
56-
icon: PropTypes.node
53+
icon: PropTypes.node,
5754
};
5855

5956
export default DownloadCard;

src/components/DownloadCard.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,4 @@
140140
.title {
141141
font-size: 1rem;
142142
}
143-
}
143+
}

src/components/DownloadSection.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState } from 'react';
1+
import React, {useState} from 'react';
22
import clsx from 'clsx';
33
import DownloadCard from './DownloadCard';
44
import styles from './DownloadSection.module.css';
@@ -9,7 +9,7 @@ const DownloadSection = ({
99
description,
1010
downloads,
1111
isCollapsible = false,
12-
defaultExpanded = true
12+
defaultExpanded = true,
1313
}) => {
1414
const [isExpanded, setIsExpanded] = useState(defaultExpanded);
1515

@@ -24,7 +24,7 @@ const DownloadSection = ({
2424
<div
2525
className={clsx(
2626
styles.sectionHeader,
27-
isCollapsible && styles.collapsible
27+
isCollapsible && styles.collapsible,
2828
)}
2929
onClick={toggleExpanded}
3030
>
@@ -41,7 +41,7 @@ const DownloadSection = ({
4141
fill="currentColor"
4242
className={clsx(styles.chevron, isExpanded && styles.expanded)}
4343
>
44-
<path d="M7.41 8.84L12 13.42l4.59-4.58L18 10.25l-6 6-6-6z"/>
44+
<path d="M7.41 8.84L12 13.42l4.59-4.58L18 10.25l-6 6-6-6z" />
4545
</svg>
4646
</button>
4747
)}
@@ -65,4 +65,4 @@ DownloadSection.propTypes = {
6565
defaultExpanded: PropTypes.bool,
6666
};
6767

68-
export default DownloadSection;
68+
export default DownloadSection;

src/components/DownloadSection.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,4 @@
8787
.toggleButton {
8888
align-self: flex-end;
8989
}
90-
}
90+
}

0 commit comments

Comments
 (0)