diff --git a/README.md b/README.md index 4c2e1399..c4aad417 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # doxa-life (doxa-maps-cdn) The team's shared Nuxt app and CDN host for the Doxa maps. Static drop-in map -builds live under `public/js/doxa-maps-build/`, and the app serves the Mapbox +builds live under `public/embed/doxa-maps-build/`, and the app serves the Mapbox token endpoint that those maps use at runtime. ## Maps & map tokens @@ -13,7 +13,7 @@ The maps support two providers: **MapLibre** and **Mapbox**. MapLibre-based maps need **no API token**. The build sets `var TOKEN_FREE = true;` and mounts the map with an empty token (`provider: 'maplibre'`, using `window.maplibregl`), skipping the token ladder entirely. -See `public/js/doxa-maps-build/doxa-maps/demo-map/demo-map/maplibre/index.html`. +See `public/embed/doxa-maps-build/doxa-maps/demo-map/demo-map/maplibre/index.html`. ### Mapbox — requires a public (`pk.`) token @@ -33,7 +33,7 @@ returns JSON `{ token, type }` (with an optional `expires_in`): **Static drop-in maps — token ladder (precedence order):** the built map pages resolve a Mapbox token by walking this ladder (see -`public/js/doxa-maps-build/doxa-maps/doxa-simple-map/doxa-simple-map/engagement/index.html`). +`public/embed/doxa-maps-build/doxa-maps/doxa-simple-map/doxa-simple-map/engagement/index.html`). Rungs 1–3 yield a token used **directly, with no network call**: 1. A token hardcoded into the page's profile-config (`config.tk`) diff --git a/app/composables/useDoxaMap.ts b/app/composables/useDoxaMap.ts index f6715e82..e0537274 100644 --- a/app/composables/useDoxaMap.ts +++ b/app/composables/useDoxaMap.ts @@ -10,13 +10,13 @@ const MAPBOX_JS = 'https://api.mapbox.com/mapbox-gl-js/v3.24.0/mapbox-gl.js' const MAPBOX_GEOCODER_JS = 'https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v5.0.0/mapbox-gl-geocoder.min.js' // Map of bundle keys → CDN drop-in URLs. The built maps live under -// public/js/doxa-maps-build/ (the doxa-maps bundler's output folder, dropped in here), -// served at /js/doxa-maps-build/doxa-maps//.js. Each IIFE bundle +// public/embed/doxa-maps-build/ (the doxa-maps bundler's output folder, dropped in here), +// served at /embed/doxa-maps-build/doxa-maps//.js. Each IIFE bundle // registers its own custom element (doxa-map / doxa-research-map), so only one // bundle should load per page. const BUNDLES = { - 'simple-map': '/js/doxa-maps-build/doxa-maps/doxa-simple-map/doxa-simple-map.js', - 'research-map': '/js/doxa-maps-build/doxa-maps/doxa-research-map/doxa-research-map.js' + 'simple-map': '/embed/doxa-maps-build/doxa-maps/doxa-simple-map/doxa-simple-map.js', + 'research-map': '/embed/doxa-maps-build/doxa-maps/doxa-research-map/doxa-research-map.js' } as const type BundleKey = keyof typeof BUNDLES diff --git a/app/pages/doxa-maps.vue b/app/pages/doxa-maps.vue index 4a03b82b..6be24c60 100644 --- a/app/pages/doxa-maps.vue +++ b/app/pages/doxa-maps.vue @@ -2,7 +2,7 @@ // doxa.life/doxa-maps — the DOXA maps SPA (every map, one app). // // Frames the bundler's single-page app (the app-wrapper shell) from the -// drop-in at public/js/doxa-maps-build/ — every map, table and dashboard the +// drop-in at public/embed/doxa-maps-build/ — every map, table and dashboard the // bundler ships, composed into one lazy-loaded app, always exactly as current // as the build in this repo. Pointed to from the research page // ("See all DOXA maps →"). @@ -29,7 +29,7 @@ onMounted(async () => { if (tk) q.set('tk', tk) if (utm) q.set('utm_source', utm) const qs = q.toString() - frameSrc.value = '/js/doxa-maps-build/index.html' + (qs ? `?${qs}` : '') + frameSrc.value = '/embed/doxa-maps-build/index.html' + (qs ? `?${qs}` : '') }) useHead({ title: 'All DOXA Maps', diff --git a/app/pages/research/index.vue b/app/pages/research/index.vue index c23428ce..cdd7c143 100644 --- a/app/pages/research/index.vue +++ b/app/pages/research/index.vue @@ -8,7 +8,7 @@ // Below the UupgsList we embed the 5-tab `research-map` IIFE built from // the upstream DOXA-MAPS module — exposes Engagement / Prayer // / Adoption (clones of doxa-simple-map) plus Language Families. The -// the doxa-maps build now publishes /js/doxa-maps-build/doxa-maps/doxa-research-map/doxa-research-map.js (canonical name). +// the doxa-maps build now publishes /embed/doxa-maps-build/doxa-maps/doxa-research-map/doxa-research-map.js (canonical name). // via the publishToDoxaLife() plugin. import { buildUupgListTranslations } from '~/utils/uupgListTranslations' @@ -42,7 +42,7 @@ useTextHighlight() showError('Could not load the map bundle ' + s.src + '.'); document.head.appendChild(s); })();