Subdomain: the menu's Research item links to the Research Gallery subdomain (from config); Research and Regions pages leave the menu
This commit is contained in:
parent
d5d72e8e76
commit
0a0bfdf8b3
5 changed files with 30 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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<string, unknown>)[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'"
|
||||
>
|
||||
<ul id="secondary-menu" class="role-list stack">
|
||||
<li v-for="item in SECONDARY_NAV" :key="item.key" class="menu-item">
|
||||
<li v-for="item in secondaryNav" :key="item.key" class="menu-item">
|
||||
<a
|
||||
v-if="item.href"
|
||||
:href="item.href"
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@ export interface NavItem {
|
|||
to?: string // internal route (passed through localePath in components)
|
||||
href?: string // external URL (no locale prefix)
|
||||
rel?: string // e.g. 'noopener'
|
||||
// external URL taken from runtime config (public.<name>) instead of a fixed href
|
||||
hrefConfig?: 'researchGalleryUrl'
|
||||
// kept in the list but not shown: switched off rather than deleted
|
||||
off?: boolean
|
||||
}
|
||||
|
||||
// Main header navigation (desktop). Minimal on purpose — the full list
|
||||
|
|
@ -27,10 +31,14 @@ export const FOOTER_NAV: NavItem[] = [
|
|||
// all viewports. Mirrors the live `#secondary-menu` list.
|
||||
export const SECONDARY_NAV: NavItem[] = [
|
||||
{ key: 'About', to: '/about' },
|
||||
{ key: 'Research', to: '/research' },
|
||||
// The Research Gallery lives on its own subdomain (the Plugin Studio container), so the Research
|
||||
// item links there (NUXT_PUBLIC_RESEARCH_GALLERY_URL). This site's own /research page is kept but no
|
||||
// longer in the menu.
|
||||
{ key: 'Research', hrefConfig: 'researchGalleryUrl' },
|
||||
{ key: 'Pray', to: '/pray' },
|
||||
{ key: 'Adopt', to: '/adopt' },
|
||||
{ key: 'Resources', to: '/resources' },
|
||||
{ key: 'Regions', to: '/regions' },
|
||||
// Off: the Regions view is part of the Research Gallery. The /regions pages are kept.
|
||||
{ key: 'Regions', to: '/regions', off: true },
|
||||
{ key: 'Give', href: 'https://giving.ag.org/donate/600001-6C2327?utm_source=direct_link' }
|
||||
]
|
||||
|
|
|
|||
|
|
@ -290,6 +290,9 @@ export default defineNuxtConfig({
|
|||
// 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',
|
||||
// The Research Gallery's own subdomain, served by the Plugin Studio container. The hamburger
|
||||
// menu's Research item links here.
|
||||
researchGalleryUrl: process.env.NUXT_PUBLIC_RESEARCH_GALLERY_URL || 'https://research.nuxtbase.app',
|
||||
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',
|
||||
|
|
|
|||
Loading…
Reference in a new issue