Process: SOP
See github repo sop-docs
To create a new site:
C:\Users\saad0\Documents\source\sop-docs>npx create-docusaurus@latest <website-name> classic
Yes 👍 — Docusaurus is just a static site generator (like Jekyll or Hugo). The end product is plain HTML, CSS, and JS files, which means you can absolutely deploy it to cPanel hosting.
Here’s how to do it:
Step 1 — Build Your Docs Site
On your local machine (or dev server):
cd sop-docs
npm run build
This creates a /build folder containing your static site.
Step 2 — Upload to cPanel
You have two main options:
🔹 Option A — File Manager
-
Log into your cPanel.
-
Open File Manager → go to
public_html/(or a subfolder if you wantyourdomain.com/docs). -
Delete any old files (if this is a fresh site).
-
Upload the contents of the
/buildfolder.-
⚠️ Important: upload the contents (index.html, assets folder, etc.), not the parent
/buildfolder itself.
-
🔹 Option B — FTP / SFTP
-
Connect with FileZilla or your preferred FTP client.
-
Navigate to
public_html/. -
Drag everything from
/buildinto that folder.
Step 3 — Verify
-
Visit
https://yourdomain.com(orhttps://yourdomain.com/docsif in a subfolder). -
The docs site should load instantly.
Step 4 — (Optional) Subdomain Setup
If you want docs.yourdomain.com:
-
In cPanel → Domains → Create Subdomain (
docs.yourdomain.com). -
Point it to a folder (e.g.,
/public_html/docs/). -
Upload your
/buildcontents there. -
Make sure SSL is enabled (Let’s Encrypt usually auto-handles it).
👉 So yes — Docusaurus works perfectly with cPanel, because cPanel just serves static files.
Do you want me to write you a step-by-step deployment script/checklist specifically for your VA/SDR SOP site, so you or your VA can upload without breaking anything?
Short answer: yes—Docusaurus is a great fit for SOPs in Markdown. If it feels slow, it’s usually due to a few common gotchas that are easy to fix.
Is Docusaurus the right tool?
-
Built for Markdown (and MDX) docs with sidebars, versioning, search, and a clean theme out-of-the-box.
-
Git-first workflow: PRs = reviews of SOP changes.
-
Static site output: easy to host anywhere (including cPanel) and put behind a CDN.
-
Good plugin ecosystem (search, sitemap, ideal images, etc.).
If your needs are just “super light, no JS bells/whistles,” MkDocs Material is even lighter and can load faster. But for teams, versioned docs, and nice UX, Docusaurus is solid.
Why does it feel slow (and how to speed it up)?
Most slowness comes from initial JS/CSS payloads and third-party scripts. Here’s a focused checklist:
1) Use a production build + CDN
-
Build:
npm run build(oryarn build). Don’t judge speed fromnpm run start(dev mode is slow). -
Serve the
/buildfolder via your host and put it behind a CDN (Cloudflare/CloudFront). -
Set long cache headers for static assets:
-
Cache-Control: public, max-age=31536000, immutablefor hashed JS/CSS/Images. -
Cache-Control: public, max-age=300for HTML.
-
2) Trim third-party scripts
-
Analytics, chat widgets, heatmaps, etc. add big network cost.
-
Load them
async/deferor remove entirely. Indocusaurus.config.js:
scripts: [
{src: 'https://www.googletagmanager.com/gtag/js?id=G-XXXX', async: true},
{src: '/js/your-small-helper.js', defer: true},
],
3) Optimize images & fonts
-
Use
@docusaurus/plugin-ideal-imagefor responsive, lazy-loaded images. -
Self-host fonts or stick to system fonts to avoid render-blocking Google Fonts:
/* Use system font stack for instant text rendering */
html { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
4) Keep the JS bundle lean
-
Remove unused Prism languages (syntax highlighting) to shrink bundles:
themeConfig: {
prism: {
additionalLanguages: ['bash', 'python'], // only what you need
},
}
-
Avoid heavy client components in MDX. Prefer pure Markdown for SOPs.
-
If you don’t need search yet, disable it. Algolia DocSearch or local-search both add JS weight.
5) Minimize home page “furniture”
-
Big hero images, carousels, and embedded iframes delay first paint. Keep the homepage simple.
-
Prefer many small doc pages over one mega page.
6) Preload critical assets
-
If you keep a custom font, add a
<link rel="preload" as="font" crossorigin>in the<head>viathemeConfig→metadataor a customHead:
headTags: [
{
tagName: 'link',
attributes: {
rel: 'preload',
as: 'font',
href: '/fonts/Inter-roman.var.woff2',
type: 'font/woff2',
crossorigin: 'anonymous',
},
},
];
7) Measure, don’t guess
-
Run Lighthouse (Chrome DevTools → Lighthouse) on your production build.
-
Check request waterfall for slow or blocking assets.
-
If you’re curious about bundle size, run a build with a bundle analyzer (there are community guides for Docusaurus + webpack-bundle-analyzer).
Quick deployment to cPanel (static hosting)
-
npm ci && npm run build -
Upload the contents of
build/to your domain’spublic_html(or a subfolder). -
Ensure your site path matches
baseUrlindocusaurus.config.js(e.g.,/vs/docs/). -
Add caching rules in
.htaccess(Apache) for static files:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/html "access plus 5 minutes"
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType font/woff2 "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
</IfModule>
<IfModule mod_headers.c>
<FilesMatch "\.(js|css|png|jpg|jpeg|gif|webp|svg|woff2)$">
Header set Cache-Control "public, max-age=31536000, immutable"
</FilesMatch>
</IfModule>
When to consider MkDocs Material instead
-
You want the absolute fastest first load with minimal JS.
-
You don’t need React/MDX components, just straightforward Markdown + search.
-
You prefer Python-based tooling.
If you want, tell me:
-
Your current theme/plugins
-
Whether you’re using search, analytics, or chat
-
A sample page that feels slow
…and I’ll give you a tailored, cut-down config that keeps the nice bits and sheds the weight.
Comments
Post a Comment