Maps drop-in moves to /embed/doxa-maps-build; old /js links redirect

- The generated maps output now lives under public/embed/ next to the embed page;
  the site's map slots, the full-page maps view and the embed page point there
- /js/doxa-maps-build/** and the older /js/doxa-maps/** answer 301 to the new location,
  so links already shared keep working
- Frame policy follows the new path
This commit is contained in:
swift-river542 2026-09-16 19:05:50 -05:00
parent d8dbf6f358
commit 99873d85d9
825 changed files with 17 additions and 16 deletions

View file

@ -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`)

View file

@ -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/<bundle>/<bundle>.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/<bundle>/<bundle>.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

View file

@ -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',

View file

@ -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()
</div>
<!-- Research map embed — sits directly under the H1, above the UUPG
search bar. Loads /js/doxa-maps-build/doxa-maps/doxa-research-map/doxa-research-map.js (auto-published from
search bar. Loads /embed/doxa-maps-build/doxa-maps/doxa-research-map/doxa-research-map.js (auto-published from
the upstream module on every research-mfe build). -->
<DoxaMapSlot
map-id="research-page-map"

View file

@ -154,16 +154,17 @@ export default defineNuxtConfig({
},
routeRules: {
// LEGACY MAP PATHS HEAL THEMSELVES: the drop-in moved to /js/doxa-maps-build/
// LEGACY MAP PATHS HEAL THEMSELVES: the drop-in lives at /embed/doxa-maps-build/ (earlier: /js/doxa-maps/, then /js/doxa-maps-build/)
// (one output folder under the js path). Any old /js/doxa-maps/... link —
// bookmarks, muscle memory, older embeds — 301s to the current location.
'/js/doxa-maps/**': { redirect: { to: '/js/doxa-maps-build/doxa-maps/**', statusCode: 301 } },
'/js/doxa-maps/**': { redirect: { to: '/embed/doxa-maps-build/doxa-maps/**', statusCode: 301 } },
'/js/doxa-maps-build/**': { redirect: { to: '/embed/doxa-maps-build/**', statusCode: 301 } },
// THE DROP-IN STAYS FRAMEABLE: every partner-site embed is an iframe of one of these leaf
// pages, so they must be embeddable from ANY origin. Nitro does not read the bundler's
// public/_headers frame policy — this rule is the site-side contract. Without it, a future
// global X-Frame-Options / frame-ancestors header would blank every embedded map at once.
'/js/doxa-maps-build/doxa-maps/**': { headers: { 'content-security-policy': 'frame-ancestors *' } },
'/embed/doxa-maps-build/doxa-maps/**': { headers: { 'content-security-policy': 'frame-ancestors *' } },
// Content-hashed build assets never change under the same URL — cache forever.
'/_nuxt/**': { headers: { 'cache-control': 'public, max-age=31536000, immutable' } },

View file

Before

Width:  |  Height:  |  Size: 217 KiB

After

Width:  |  Height:  |  Size: 217 KiB

View file

Before

Width:  |  Height:  |  Size: 216 KiB

After

Width:  |  Height:  |  Size: 216 KiB

View file

Before

Width:  |  Height:  |  Size: 220 KiB

After

Width:  |  Height:  |  Size: 220 KiB

View file

Before

Width:  |  Height:  |  Size: 232 KiB

After

Width:  |  Height:  |  Size: 232 KiB

View file

Before

Width:  |  Height:  |  Size: 219 KiB

After

Width:  |  Height:  |  Size: 219 KiB

View file

Before

Width:  |  Height:  |  Size: 240 KiB

After

Width:  |  Height:  |  Size: 240 KiB

View file

Before

Width:  |  Height:  |  Size: 219 KiB

After

Width:  |  Height:  |  Size: 219 KiB

View file

Before

Width:  |  Height:  |  Size: 223 KiB

After

Width:  |  Height:  |  Size: 223 KiB

View file

Before

Width:  |  Height:  |  Size: 224 KiB

After

Width:  |  Height:  |  Size: 224 KiB

View file

Before

Width:  |  Height:  |  Size: 238 KiB

After

Width:  |  Height:  |  Size: 238 KiB

View file

Before

Width:  |  Height:  |  Size: 197 KiB

After

Width:  |  Height:  |  Size: 197 KiB

View file

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 101 KiB

View file

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 142 KiB

View file

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 101 KiB

Some files were not shown because too many files have changed in this diff Show more