From 0a0bfdf8b36794f2457655fa1b6fb10cd24ed2e6 Mon Sep 17 00:00:00 2001 From: driver Date: Mon, 28 Sep 2026 05:11:10 +0000 Subject: [PATCH] Subdomain: the menu's Research item links to the Research Gallery subdomain (from config); Research and Regions pages leave the menu --- .env.example | 3 +++ DX-MAPS-GALLERY.md | 15 +++++++-------- app/components/public/TheHeader.vue | 9 +++++++-- app/utils/nav.ts | 12 ++++++++++-- nuxt.config.ts | 3 +++ 5 files changed, 30 insertions(+), 12 deletions(-) diff --git a/.env.example b/.env.example index 0d0fdbbd..70872854 100644 --- a/.env.example +++ b/.env.example @@ -42,6 +42,9 @@ NUXT_PUBLIC_MAPBOX_TOKEN=your-mapbox-public-token # The CDN must send Access-Control-Allow-Origin for the tree. # NUXT_PUBLIC_DX_MAPS_BASE=https://maps-dev.nuxtbase.app/cdn/dx-maps +# The Research Gallery's subdomain (the hamburger menu's Research item links here). +# NUXT_PUBLIC_RESEARCH_GALLERY_URL=https://research.nuxtbase.app + # Cloudflare Turnstile NUXT_TURNSTILE_SITE_KEY=your-turnstile-site-key NUXT_TURNSTILE_SECRET_KEY=your-turnstile-secret-key diff --git a/DX-MAPS-GALLERY.md b/DX-MAPS-GALLERY.md index 0939140b..4d969b13 100644 --- a/DX-MAPS-GALLERY.md +++ b/DX-MAPS-GALLERY.md @@ -52,15 +52,14 @@ 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. -## Deployment method: every map from the maps CDN (this branch, research-gallery-js) +## Deployment method: the Research Gallery on its own subdomain (this branch, research-gallery-subdomain) -Every map on this site loads as **JavaScript from the maps CDN**, the Plugin Studio container's `/cdn`: -`NUXT_PUBLIC_DX_MAPS_BASE`, default `https://maps-dev.nuxtbase.app/cdn/dx-maps`. That covers the Research -Gallery, the home (engagement), pray (prayer) and adopt maps (`useDoxaMap`, `DoxaMapSlot`), and the two -static pages `public/embed/map/` and `public/research/doxa-research-map.html` (static, so they carry the same -URL as a constant). Each map is also told its `assetsBase` in that tree, so its styles and boundaries come -from the CDN too. **`public/dx-maps/` is removed**: this site serves no copy of the tree. No iframe is used. -The CDN sends `Access-Control-Allow-Origin: *`. +The hamburger menu's **Research** item links to the Research Gallery on its own subdomain, served by the +Plugin Studio container: `NUXT_PUBLIC_RESEARCH_GALLERY_URL`, default `https://research.nuxtbase.app`. The +menu no longer lists this site's Research page or its **Regions** page (the Regions item is switched off +with `off: true` in `app/utils/nav.ts`, not deleted; both pages still exist at `/research` and `/regions`, +and in-page links to them, such as the home map's research button, are unchanged). The site's other maps +and `/embed-test` load as JavaScript from the maps CDN, as on research-gallery-js. No iframe is used. ## /embed-test diff --git a/app/components/public/TheHeader.vue b/app/components/public/TheHeader.vue index 72cead22..a9cededb 100644 --- a/app/components/public/TheHeader.vue +++ b/app/components/public/TheHeader.vue @@ -3,7 +3,12 @@ // Layout: logo + WAGF tagline on the left, primary nav + hamburger toggle // on the right, plus a slide-down hamburger overlay for mobile. -import { PRIMARY_NAV, SECONDARY_NAV } from '~/utils/nav' +import { PRIMARY_NAV, SECONDARY_NAV, type NavItem } from '~/utils/nav' +const runtimeConfig = useRuntimeConfig() +// Items switched off are not shown; an item whose URL comes from config gets it here. +const secondaryNav = computed(() => SECONDARY_NAV.filter((i) => !i.off).map((i): NavItem => + i.hrefConfig ? { ...i, href: String((runtimeConfig.public as Record)[i.hrefConfig] || '') } : i) + .filter((i) => i.href || i.to)) const { t } = useI18n() const localePath = useLocalePath() @@ -29,7 +34,7 @@ watch(() => route.fullPath, close) :data-state="isOpen ? 'open' : 'closed'" >