diff --git a/AGENTS.md b/AGENTS.md index eb1e31c..9e93239 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -143,7 +143,7 @@ repoUrl: https://... # optional GitHub repo URL note: ... # optional note shown on detail page ``` -The slug used for the URL is derived from the filename (e.g., `my-project.yml` → `/labs/my-project`). +The slug used for the URL is derived from the filename (e.g., `my-project.yml` → `/labs/my-project/`). ### Adding a talk entry diff --git a/CLAUDE.md b/CLAUDE.md index 72884dc..dc18419 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -145,7 +145,7 @@ repoUrl: https://... # optional GitHub repo URL note: ... # optional note shown on detail page ``` -The slug used for the URL is derived from the filename (e.g., `my-project.yml` → `/labs/my-project`). +The slug used for the URL is derived from the filename (e.g., `my-project.yml` → `/labs/my-project/`). ### Adding a talk entry diff --git a/app/app.vue b/app/app.vue index ca58635..a4b5ab3 100644 --- a/app/app.vue +++ b/app/app.vue @@ -5,8 +5,12 @@ const baseURL = runtimeConfig.app.baseURL const basePrefix = baseURL.replace(/\/$/, '') +// Canonical URLs use the trailing-slash form (see `site.trailingSlash` in +// nuxt.config.ts); normalise here so a slash-less route never leaks through. const canonicalUrl = computed(() => { - return new URL(`${basePrefix}${route.path || '/'}`, runtimeConfig.public.siteUrl).toString() + const path = route.path || '/' + const normalised = path.endsWith('/') ? path : `${path}/` + return new URL(`${basePrefix}${normalised}`, runtimeConfig.public.siteUrl).toString() }) useHead({ diff --git a/app/components/AppHeader.vue b/app/components/AppHeader.vue index bfc5cbf..a58659d 100644 --- a/app/components/AppHeader.vue +++ b/app/components/AppHeader.vue @@ -7,7 +7,8 @@ const links = computed(() => navLinks.map(link => ({ }))) const isActive = (to: string) => { - return to === '/' ? route.path === '/' : route.path.startsWith(to) + const current = route.path.endsWith('/') ? route.path : `${route.path}/` + return to === '/' ? current === '/' : current.startsWith(to) } diff --git a/app/components/HomeView.vue b/app/components/HomeView.vue index 4437e6d..0753910 100644 --- a/app/components/HomeView.vue +++ b/app/components/HomeView.vue @@ -106,6 +106,18 @@ const reveal = { >>_ {{ current.title }}

+

+

+

{{ intro.lead }}

diff --git a/app/components/LabDetailView.vue b/app/components/LabDetailView.vue index 1fb3905..b5e6e64 100644 --- a/app/components/LabDetailView.vue +++ b/app/components/LabDetailView.vue @@ -59,7 +59,7 @@ const reveal = {
  • labs
  • @@ -375,7 +375,7 @@ const reveal = { eyebrow="Labs" heading-id="signal-related-labs" title="More from the lab" - :link="{ label: 'All labs', to: '/labs' }" + :link="{ label: 'All labs', to: '/labs/' }" />