From d5bf4d03a063ca788b141bb5d04ce52c8bdb52b9 Mon Sep 17 00:00:00 2001 From: NikkeDoy Date: Mon, 18 May 2026 22:02:04 +0300 Subject: [PATCH] :memo: | Fix documentation. --- docs/NGINX-STATIC-HOSTING.md | 39 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/docs/NGINX-STATIC-HOSTING.md b/docs/NGINX-STATIC-HOSTING.md index 9051409..7d38a9d 100644 --- a/docs/NGINX-STATIC-HOSTING.md +++ b/docs/NGINX-STATIC-HOSTING.md @@ -23,7 +23,17 @@ pnpm install pnpm lune ci ``` -This creates the built plugin files in the `dist/` directory (e.g., `dist/gpt/plugin.js`, `dist/gpt/plugin.json`). +This creates the built plugin files in the `dist/` directory. Each plugin gets a folder matching its name (e.g., `dist/gpt-unslothed/`), containing: + +- `plugin.js` — the bundled plugin code (all JSX/JS sources are bundled into a single file) +- `plugin.json` — the plugin manifest + +Optionally, build the static website (SSG) for plugin documentation pages: + +```bash +# Build the static website (includes plugin pages and index) +pnpm lune ssg ci +``` ## Step 2: Set Up the Web Directory @@ -55,9 +65,8 @@ server { root /var/www/shelter-plugins; index index.html; - # Serve plugin files + # Serve plugin files (JS and JSON) location /gpt-unslothed { - default_type application/json; try_files $uri $uri/ =404; } @@ -67,12 +76,6 @@ server { try_files $uri $uri/ =404; } - # Serve README - location /README.md { - default_type text/markdown; - try_files $uri =404; - } - # Catch-all for 404 location = /404.html { internal; @@ -88,7 +91,7 @@ server { ### Configuration Notes - Change `plugins.your-domain.com` to your actual domain or IP address -- The `default_type application/json` ensures browsers don't try to execute the plugin files +- The `try_files` directive lets NGINX auto-detect the correct MIME type for each file - The configuration serves plugins from paths like `http://plugins.your-domain.com/gpt-unslothed/` ## Step 4: Enable the Site @@ -147,6 +150,10 @@ set -e echo "Building plugins..." pnpm lune ci +# Build static website (optional, for documentation pages) +echo "Building static website..." +pnpm lune ssg ci + # Copy files echo "Copying files to web directory..." sudo rsync -av --delete dist/ /var/www/shelter-plugins/ @@ -170,12 +177,9 @@ After deployment, your server should look like this: ``` /var/www/shelter-plugins/ -├── gpt-unslothed/ -│ ├── plugin.json -│ ├── index.jsx -│ └── settings.jsx -└── previews/ - └── gpt.png +└── gpt-unslothed/ + ├── plugin.json + └── plugin.js ``` ## Troubleshooting @@ -204,8 +208,5 @@ location / { if ($request_method = 'OPTIONS') { return 204; } - - default_type application/json; - try_files $uri $uri/ =404; } ```