74 lines
3.2 KiB
Markdown
74 lines
3.2 KiB
Markdown
# Dotjuice Docs (Docusaurus)
|
|
|
|
Self-hosted documentation site, built with [Docusaurus](https://docusaurus.io) v3.10.2.
|
|
|
|
## Layout
|
|
|
|
```
|
|
docker-compose.yaml # the stack
|
|
.env # container name, port, production URL
|
|
site/ # the Docusaurus app itself (config, theme, homepage) — built into the image
|
|
docs/ # the actual markdown content — bind-mounted, edit freely without rebuilding
|
|
```
|
|
|
|
`docs/` is organised one folder per plugin, matching the sidebar:
|
|
|
|
```
|
|
docs/
|
|
intro.md # docs landing page (served at /docs/)
|
|
dotjuice-elementor-tools/ # free plugin
|
|
getting-started.md
|
|
screenshot-api-settings.md
|
|
woocommerce-account-settings.md
|
|
product-attribute-colours.md
|
|
widgets/ # one file per widget
|
|
dotjuice-elementor-tools-pro/ # pro plugin
|
|
getting-started.md
|
|
license-activation.md
|
|
widgets/
|
|
dotjuice-pagespeed/ # pagespeed plugin (flat, no widgets/ subfolder)
|
|
getting-started.md
|
|
caching.md, css-optimisation.md, ...
|
|
```
|
|
|
|
Each plugin folder has a `_category_.json` controlling its sidebar label and position — the sidebar itself is fully auto-generated from this folder structure (`sidebars.js`), so adding a new `.md` file anywhere under `docs/` makes it appear automatically, no config edit needed.
|
|
|
|
## Spinning it up
|
|
|
|
```bash
|
|
cd /home/jandieman/docker/docusaurus
|
|
docker compose up -d --build
|
|
```
|
|
|
|
First build takes a minute or two (`npm install` inside the image). After that, `docker compose logs -f docusaurus` should show `[SUCCESS] Serving "build" directory at: http://0.0.0.0:3000/`.
|
|
|
|
Point Nginx Proxy Manager's proxy host at:
|
|
- **Forward Hostname/IP:** `docusaurus-docs` (the container name — resolvable by any container on the shared `proxy` network)
|
|
- **Forward Port:** `3000`
|
|
|
|
## Editing content
|
|
|
|
Edit or add markdown files under `docs/`, then either:
|
|
|
|
```bash
|
|
docker compose restart docusaurus # picks up doc changes, same image
|
|
```
|
|
|
|
or, if you've changed `site/` (theme, config, navbar, homepage):
|
|
|
|
```bash
|
|
docker compose up -d --build # rebuilds the image too
|
|
```
|
|
|
|
Either way, the container rebuilds the static site fresh on every start — there's no separate "build step" to remember, just restart the container after editing.
|
|
|
|
## Changing the production URL
|
|
|
|
Edit `SITE_URL` in `.env`, then `docker compose up -d --build`. Docusaurus bakes this URL into the built site (canonical links, sitemap, social-card meta tags), so it needs a rebuild to take effect — it isn't read live per-request.
|
|
|
|
## Known follow-up
|
|
|
|
A handful of "See Pro" / "See free plugin" cross-links inside the docs were written for the original plugin repo structure and were adjusted during setup — all internal links were checked and resolve correctly as of this build. If you reorganise the `docs/` folder structure later, re-check cross-plugin links (the free and pro plugin folders link to each other in a few places, e.g. product-attribute-colours ↔ the Pro widget that displays swatches).
|
|
|
|
The marketing/"what it does" copy (as opposed to this how-to content) is intended for regular Elementor pages on dotjuice.co.uk, not this docs site — see each plugin's `documentation/marketing/` folder in its own repo.
|