Skip to content

Commit

Permalink
Handle cases where route slug is not present
Browse files Browse the repository at this point in the history
  • Loading branch information
philliphartin committed Feb 29, 2024
1 parent 6d24b2a commit df8454d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nuxt-module/docs/components/content/PageTitle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="flex items-center gap-2 mb-4 text-sm font-medium text-gray-400 dark:text-white/50">
<div>Docs</div>
<div>/</div>
<div class="capitalize">{{ route.params.slug.at(-1) }}</div>
<div class="capitalize" v-if="route.params.slug?.at(-1)">{{ route.params.slug?.at(-1) }}</div>
</div>
<div class="dark:text-white text-gray-950">
<slot />
Expand Down
4 changes: 2 additions & 2 deletions nuxt-module/docs/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
</nav>

<!-- Content -->
<div class="min-h-screen w-full md:w-7/12 text-gray-950 dark:text-white" :class="route.params.slug">
<NuxtPage class="w-full" :class="route.params.slug.at(0) === 'docs' ? 'divide-y divide-dashed dark:divide-white/10' : ''" />
<div class="min-h-screen w-full md:w-7/12 text-gray-950 dark:text-white" :class="route.params.slug ?? null">
<NuxtPage class="w-full" :class="route.params.slug?.at(0) === 'docs' ? 'divide-y divide-dashed dark:divide-white/10' : ''" />
<!-- Jagger Swagger -->
<section v-if="route.fullPath === '/docs/actions'" id="jagger" class="flex bg-indigo-900 h-96 overflow-clip rounded-2xl mt-24 items-center justify-center relative">
Expand Down

0 comments on commit df8454d

Please sign in to comment.