diff --git a/.env.example b/.env.example index 8349e38b..0d0fdbbd 100644 --- a/.env.example +++ b/.env.example @@ -37,8 +37,9 @@ MOBILE_APP_ANDROID_PACKAGE=life.doxa.pray # Mapbox (used by the prayer map on /pray) NUXT_PUBLIC_MAPBOX_TOKEN=your-mapbox-public-token -# Research page: load the dx-maps tree from a maps CDN instead of this site's public/dx-maps copy. -# Unset = the local copy. The CDN must send Access-Control-Allow-Origin for the tree. +# Research page: where the dx-maps tree loads from. Unset = the maps CDN below (this branch's default). +# Set it empty (NUXT_PUBLIC_DX_MAPS_BASE=) to use this site's own public/dx-maps copy instead. +# The CDN must send Access-Control-Allow-Origin for the tree. # NUXT_PUBLIC_DX_MAPS_BASE=https://maps-dev.nuxtbase.app/cdn/dx-maps # Cloudflare Turnstile diff --git a/DX-MAPS-GALLERY.md b/DX-MAPS-GALLERY.md index a5f00c29..a87ed477 100644 --- a/DX-MAPS-GALLERY.md +++ b/DX-MAPS-GALLERY.md @@ -52,13 +52,13 @@ or `.env` is needed for this page. Without `DATABASE_URL`, the dev server only l `regions-dashboard`, `upg-100`, and so on). - Share and embed links in the maps point at this site's own `/dx-maps/` pages. -## Maps from a CDN instead of the local copy +## Maps from the CDN (this branch's default) -Set `NUXT_PUBLIC_DX_MAPS_BASE` to a dx-maps tree URL, for example -`NUXT_PUBLIC_DX_MAPS_BASE=https://maps-dev.nuxtbase.app/cdn/dx-maps`. The Research page then loads the -gallery script and every map from there. That host must send `Access-Control-Allow-Origin` for the tree. -Unset (the default), the page uses this site's own `public/dx-maps/` copy, as above. The home, pray and adopt -maps still load from the local copy. +On this branch the Research page loads the gallery script and every map from the maps CDN, +`https://maps-dev.nuxtbase.app/cdn/dx-maps`, by default. Set `NUXT_PUBLIC_DX_MAPS_BASE` to another dx-maps +tree URL to use that instead. Set it empty (`NUXT_PUBLIC_DX_MAPS_BASE=`) to use this site's own +`public/dx-maps/` copy. The host must send `Access-Control-Allow-Origin` for the tree. The home, pray and +adopt maps still load from the local copy. ## Updating the maps diff --git a/nuxt.config.ts b/nuxt.config.ts index 9a85a8ff..db41056f 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -286,9 +286,10 @@ export default defineNuxtConfig({ siteUrl: process.env.NUXT_PUBLIC_SITE_URL || '', prayBaseUrl: process.env.NUXT_PUBLIC_PRAY_BASE_URL || 'https://pray.doxa.life', mapboxToken: process.env.NUXT_PUBLIC_MAPBOX_TOKEN || '', - // Where the Research page loads the dx-maps tree from (e.g. https://maps-dev.nuxtbase.app/cdn/dx-maps). - // Unset: this site's own /dx-maps/ copy (public/dx-maps). A foreign host must send CORS for the tree. - dxMapsBase: process.env.NUXT_PUBLIC_DX_MAPS_BASE || '', + // Where the Research page loads the dx-maps tree from. This branch defaults to the maps CDN (the + // Plugin Studio container's /cdn). Set NUXT_PUBLIC_DX_MAPS_BASE= (empty) to use this site's own + // /dx-maps/ copy (public/dx-maps) instead. A foreign host must send CORS for the tree. + dxMapsBase: process.env.NUXT_PUBLIC_DX_MAPS_BASE ?? 'https://maps-dev.nuxtbase.app/cdn/dx-maps', statinatorUrl: process.env.NUXT_PUBLIC_STATINATOR_URL || 'https://statinator.doxa.life', statinatorProjectId: process.env.NUXT_PUBLIC_STATINATOR_PROJECT_ID || 'doxa', statinatorEnabled: process.env.NUXT_PUBLIC_STATINATOR_ENABLED === 'true',