cinqcinqdev-seo 0.1.43 → 0.1.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -567,33 +567,38 @@ Auth state is read from `useSupabaseUser()` provided by `@nuxtjs/supabase`. Your
567
567
 
568
568
  ## Rendering Pages on the Frontend
569
569
 
570
- Pages created in the CMS must be rendered by your Nuxt app. Since slugs can now contain slashes (e.g. `faq/my-question`), your route file **must use a catch-all segment**.
570
+ Pages created in the CMS must be rendered by your Nuxt app.
571
571
 
572
- ### Route file
572
+ ### Required route file: `pages/[...slug].vue`
573
573
 
574
- Create `pages/[...slug].vue` (not `pages/[slug].vue`):
574
+ Slugs can contain slashes (e.g. `faq/my-question` when a subdirectory is set). A standard `[slug].vue` file **only matches a single path segment** — it will never match `/faq/my-question` and will return 404.
575
575
 
576
- ```
577
- pages/
578
- [...slug].vue ✅ matches /about, /faq/my-question, /services/web-design
579
- [slug].vue ❌ only matches /about — breaks subdirectory slugs
580
- ```
576
+ You must use a **catch-all** route:
577
+
578
+ | File | Matches |
579
+ |---|---|
580
+ | `pages/[...slug].vue` ✅ | `/about`, `/faq/pricing`, `/services/web-design` |
581
+ | `pages/[slug].vue` ❌ | `/about` only — `/faq/pricing` returns 404 |
582
+
583
+ > **If you already have `pages/[slug].vue`**, rename it to `pages/[...slug].vue` and update the slug reference as shown below. Both flat slugs and subdirectory slugs will continue to work.
581
584
 
582
- ### Example `pages/[...slug].vue`
585
+ ### `pages/[...slug].vue`
583
586
 
584
587
  ```vue
585
588
  <script setup>
586
589
  const route = useRoute()
587
590
  const supabase = useSupabaseClient()
588
591
 
589
- // Join segments back into the full slug stored in the DB
590
- const slug = computed(() => (route.params.slug as string[]).join('/'))
592
+ // route.params.slug is an array of path segments join them back into the DB slug
593
+ // e.g. /faq/pricing → ['faq', 'pricing']'faq/pricing'
594
+ // e.g. /about → ['about'] → 'about'
595
+ const slug = (route.params.slug as string[]).join('/')
591
596
 
592
- const { data: page } = await useAsyncData(`page-${slug.value}`, async () => {
597
+ const { data: page } = await useAsyncData(`page-${slug}`, async () => {
593
598
  const { data } = await supabase
594
599
  .from('pages')
595
600
  .select('*')
596
- .eq('slug', slug.value)
601
+ .eq('slug', slug)
597
602
  .eq('status', 'published')
598
603
  .single()
599
604
  return data
@@ -621,7 +626,9 @@ useSeoMeta({
621
626
 
622
627
  ### How subdirectory slugs are stored
623
628
 
624
- When a page is created with subdirectory `faq` and title `What is pricing`, the slug saved to the database is `faq/what-is-pricing`. The full URL on the frontend is `/faq/what-is-pricing`. There is no separate parent page or nested table — the slash is just part of the slug string.
629
+ When a page is created with subdirectory `faq` and title `What is pricing`, the slug stored in the database is `faq/what-is-pricing`. The frontend URL is `/faq/what-is-pricing`. There is no nested table or parent record — the slash is just part of the slug string.
630
+
631
+ Pages without a subdirectory (e.g. title `About`, no subdirectory) get a plain slug like `about` and are served at `/about` — exactly as before.
625
632
 
626
633
  ---
627
634
 
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.0.0"
6
6
  },
7
- "version": "0.1.43",
7
+ "version": "0.1.44",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "unknown"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cinqcinqdev-seo",
3
- "version": "0.1.43",
3
+ "version": "0.1.44",
4
4
  "description": "A reusable Nuxt 3 admin CMS module with visual page editor powered by Supabase",
5
5
  "license": "MIT",
6
6
  "module": "./dist/module.mjs",