@murshisoft/docus 1.0.5 → 1.0.6

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.
Files changed (2) hide show
  1. package/modules/routing.ts +12 -3
  2. package/package.json +1 -1
@@ -22,9 +22,18 @@ export default defineNuxtModule({
22
22
  extendPages((pages) => {
23
23
  const landingTemplate = resolve('../app/templates/landing.vue')
24
24
 
25
- // Only add custom routes if i18n is not enabled
26
- // When i18n is enabled, it handles routing itself
27
- if (!isI18nEnabled) {
25
+ if (isI18nEnabled) {
26
+ // Add a catch-all root redirect for i18n
27
+ pages.push({
28
+ name: 'index-redirect',
29
+ path: '/',
30
+ redirect: () => {
31
+ const defaultLocale = (nuxt.options.i18n as any)?.defaultLocale || 'en'
32
+ return `/${defaultLocale}`
33
+ },
34
+ })
35
+ }
36
+ else {
28
37
  pages.push({
29
38
  name: 'index',
30
39
  path: '/',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@murshisoft/docus",
3
3
  "description": "Nuxt layer for Docus documentation theme",
4
- "version": "1.0.5",
4
+ "version": "1.0.6",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",
7
7
  "repository": {