commit 7075fd247955b28327b2458e948c61dbfa5b9508
parent dd78e83a68e08bfdc0e94054645cdcf3cc30af9b
Author: Hunter
Date: Fri, 7 Nov 2025 00:22:49 -0500
specify BASE_PATH & APP_NAME fields in generate_manifests.py
Diffstat:
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/generate_manifests.py b/generate_manifests.py
@@ -8,6 +8,16 @@ import json
import re
from pathlib import Path
+# Configuration - Edit these for your deployment
+BASE_PATH = "/vibe_capsule/" # Path where this PWA will be hosted (e.g., "/" for root, "/my-playlist/" for subdirectory)
+APP_NAME = "vibe capsule"
+
+# Derived values (can be manually overridden if desired)
+SHORT_NAME = APP_NAME
+CACHE_NAME = APP_NAME
+APP_DESCRIPTION = f"{APP_NAME} ยท vibe capsule"
+
+# File paths (no need to edit these)
SCRIPT_DIR = Path(__file__).parent.absolute()
TRACKS_JSON = SCRIPT_DIR / "tracks.json"
STYLES_CSS = SCRIPT_DIR / "styles.css"
@@ -53,12 +63,12 @@ def generate_pwa_manifests():
# Generate manifest.json
manifest = {
- "id": "/vibe_capsule/",
- "name": "vibe capsule",
- "short_name": "vibe capsule",
- "description": "mixtape as artifact",
- "start_url": "/vibe_capsule/",
- "scope": "/vibe_capsule/",
+ "id": BASE_PATH,
+ "name": APP_NAME,
+ "short_name": SHORT_NAME,
+ "description": APP_DESCRIPTION,
+ "start_url": BASE_PATH,
+ "scope": BASE_PATH,
"display": "standalone",
"background_color": background_color,
"theme_color": background_color,
@@ -100,8 +110,8 @@ def generate_pwa_manifests():
# Generate service-worker.js
static_files = resource_manifest["static_files"]
- service_worker_content = f'''// Auto-generated service worker for vibe capsule PWA
-const CACHE_NAME = 'vibe-capsule';
+ service_worker_content = f'''// Auto-generated service worker for {APP_NAME} PWA
+const CACHE_NAME = '{CACHE_NAME}';
const staticFilesToCache = {json.dumps(static_files, indent=2)};
// Get the base path from the service worker location