bsmnt 0.4.1 → 0.4.2
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/dist/{helpers/add → application/add-hooks}/index.d.ts +4 -4
- package/dist/application/add-hooks/index.d.ts.map +1 -0
- package/dist/{helpers/add → application/add-hooks}/index.js +22 -35
- package/dist/application/add-hooks/index.js.map +1 -0
- package/dist/{utils → application/add-integration}/format-results.d.ts +1 -6
- package/dist/application/add-integration/format-results.d.ts.map +1 -0
- package/dist/{utils → application/add-integration}/format-results.js +1 -6
- package/dist/application/add-integration/format-results.js.map +1 -0
- package/dist/{helpers/integrate → application/add-integration}/index.d.ts +2 -1
- package/dist/application/add-integration/index.d.ts.map +1 -0
- package/dist/{helpers/integrate → application/add-integration}/index.js +46 -41
- package/dist/application/add-integration/index.js.map +1 -0
- package/dist/application/create-project/build-context.d.ts +9 -0
- package/dist/application/create-project/build-context.d.ts.map +1 -0
- package/dist/application/create-project/build-context.js +13 -0
- package/dist/application/create-project/build-context.js.map +1 -0
- package/dist/application/create-project/index.d.ts +44 -0
- package/dist/application/create-project/index.d.ts.map +1 -0
- package/dist/application/create-project/index.js +70 -0
- package/dist/application/create-project/index.js.map +1 -0
- package/dist/application/create-project/map-selection-to-registry.d.ts +3 -0
- package/dist/application/create-project/map-selection-to-registry.d.ts.map +1 -0
- package/dist/application/create-project/map-selection-to-registry.js +30 -0
- package/dist/application/create-project/map-selection-to-registry.js.map +1 -0
- package/dist/application/create-project/resolve-selection.d.ts +15 -0
- package/dist/application/create-project/resolve-selection.d.ts.map +1 -0
- package/dist/application/create-project/resolve-selection.js +11 -0
- package/dist/application/create-project/resolve-selection.js.map +1 -0
- package/dist/{helpers/skills → application/install-skills}/index.d.ts +1 -1
- package/dist/application/install-skills/index.d.ts.map +1 -0
- package/dist/{helpers/skills → application/install-skills}/index.js +31 -44
- package/dist/application/install-skills/index.js.map +1 -0
- package/dist/{utils/detect-project.d.ts → application/shared/project-detection.d.ts} +8 -15
- package/dist/application/shared/project-detection.d.ts.map +1 -0
- package/dist/{utils/detect-project.js → application/shared/project-detection.js} +8 -24
- package/dist/application/shared/project-detection.js.map +1 -0
- package/dist/core/create/build-plan.d.ts +8 -0
- package/dist/core/create/build-plan.d.ts.map +1 -0
- package/dist/core/create/build-plan.js +89 -0
- package/dist/core/create/build-plan.js.map +1 -0
- package/dist/core/create/execute-plan.d.ts +23 -0
- package/dist/core/create/execute-plan.d.ts.map +1 -0
- package/dist/core/create/execute-plan.js +23 -0
- package/dist/core/create/execute-plan.js.map +1 -0
- package/dist/core/create/internal-ids.d.ts +23 -0
- package/dist/core/create/internal-ids.d.ts.map +1 -0
- package/dist/core/create/internal-ids.js +36 -0
- package/dist/core/create/internal-ids.js.map +1 -0
- package/dist/core/create/registry.d.ts +12 -0
- package/dist/core/create/registry.d.ts.map +1 -0
- package/dist/core/create/registry.js +33 -0
- package/dist/core/create/registry.js.map +1 -0
- package/dist/core/create/types.d.ts +96 -0
- package/dist/core/create/types.d.ts.map +1 -0
- package/dist/core/create/types.js +2 -0
- package/dist/core/create/types.js.map +1 -0
- package/dist/domain/agents.d.ts +61 -0
- package/dist/domain/agents.d.ts.map +1 -0
- package/dist/domain/agents.js +35 -0
- package/dist/domain/agents.js.map +1 -0
- package/dist/domain/animations.d.ts +20 -0
- package/dist/domain/animations.d.ts.map +1 -0
- package/dist/domain/animations.js +13 -0
- package/dist/domain/animations.js.map +1 -0
- package/dist/domain/cms.d.ts +24 -0
- package/dist/domain/cms.d.ts.map +1 -0
- package/dist/domain/cms.js +13 -0
- package/dist/domain/cms.js.map +1 -0
- package/dist/domain/hooks.d.ts +67 -0
- package/dist/domain/hooks.d.ts.map +1 -0
- package/dist/domain/hooks.js +52 -0
- package/dist/domain/hooks.js.map +1 -0
- package/dist/domain/skills.d.ts +70 -0
- package/dist/domain/skills.d.ts.map +1 -0
- package/dist/domain/skills.js +84 -0
- package/dist/domain/skills.js.map +1 -0
- package/dist/domain/templates.d.ts +51 -0
- package/dist/domain/templates.d.ts.map +1 -0
- package/dist/domain/templates.js +27 -0
- package/dist/domain/templates.js.map +1 -0
- package/dist/index.js +124 -115
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/agents/register-sanity-mcp.d.ts +12 -0
- package/dist/infrastructure/agents/register-sanity-mcp.d.ts.map +1 -0
- package/dist/infrastructure/agents/register-sanity-mcp.js +153 -0
- package/dist/infrastructure/agents/register-sanity-mcp.js.map +1 -0
- package/dist/infrastructure/create/apply-copy-paths.d.ts +3 -0
- package/dist/infrastructure/create/apply-copy-paths.d.ts.map +1 -0
- package/dist/infrastructure/create/apply-copy-paths.js +12 -0
- package/dist/infrastructure/create/apply-copy-paths.js.map +1 -0
- package/dist/infrastructure/create/apply-merge-paths.d.ts +3 -0
- package/dist/infrastructure/create/apply-merge-paths.d.ts.map +1 -0
- package/dist/infrastructure/create/apply-merge-paths.js +17 -0
- package/dist/infrastructure/create/apply-merge-paths.js.map +1 -0
- package/dist/infrastructure/create/apply-package-json.d.ts +8 -0
- package/dist/infrastructure/create/apply-package-json.d.ts.map +1 -0
- package/dist/infrastructure/create/apply-package-json.js +46 -0
- package/dist/infrastructure/create/apply-package-json.js.map +1 -0
- package/dist/infrastructure/create/copy-template.d.ts +10 -0
- package/dist/infrastructure/create/copy-template.d.ts.map +1 -0
- package/dist/infrastructure/create/copy-template.js.map +1 -0
- package/dist/infrastructure/create/executor.d.ts +3 -0
- package/dist/infrastructure/create/executor.d.ts.map +1 -0
- package/dist/infrastructure/create/executor.js +21 -0
- package/dist/infrastructure/create/executor.js.map +1 -0
- package/dist/{helpers/create/init-git.d.ts → infrastructure/create/init-git-repo.d.ts} +2 -3
- package/dist/infrastructure/create/init-git-repo.d.ts.map +1 -0
- package/dist/{helpers/create/init-git.js → infrastructure/create/init-git-repo.js} +1 -4
- package/dist/infrastructure/create/init-git-repo.js.map +1 -0
- package/dist/{helpers/create/install.d.ts → infrastructure/create/install-dependencies.d.ts} +1 -1
- package/dist/infrastructure/create/install-dependencies.d.ts.map +1 -0
- package/dist/{helpers/create/install.js → infrastructure/create/install-dependencies.js} +1 -1
- package/dist/infrastructure/create/install-dependencies.js.map +1 -0
- package/dist/infrastructure/create/lifecycle-registry.d.ts +3 -0
- package/dist/infrastructure/create/lifecycle-registry.d.ts.map +1 -0
- package/dist/infrastructure/create/lifecycle-registry.js +38 -0
- package/dist/infrastructure/create/lifecycle-registry.js.map +1 -0
- package/dist/infrastructure/create/merge-registry.d.ts +3 -0
- package/dist/infrastructure/create/merge-registry.d.ts.map +1 -0
- package/dist/infrastructure/create/merge-registry.js +27 -0
- package/dist/infrastructure/create/merge-registry.js.map +1 -0
- package/dist/infrastructure/create/rename-files.d.ts.map +1 -0
- package/dist/infrastructure/create/rename-files.js.map +1 -0
- package/dist/{helpers → infrastructure}/create/setup-agent.d.ts +9 -7
- package/dist/infrastructure/create/setup-agent.d.ts.map +1 -0
- package/dist/infrastructure/create/setup-agent.js +77 -0
- package/dist/infrastructure/create/setup-agent.js.map +1 -0
- package/dist/infrastructure/create/setup-sanity.d.ts.map +1 -0
- package/dist/{helpers → infrastructure}/create/setup-sanity.js +1 -19
- package/dist/infrastructure/create/setup-sanity.js.map +1 -0
- package/dist/infrastructure/integrations/inject-integration.d.ts +9 -0
- package/dist/infrastructure/integrations/inject-integration.d.ts.map +1 -0
- package/dist/{helpers/integrate/merge-orchestrator.js → infrastructure/integrations/inject-integration.js} +26 -38
- package/dist/infrastructure/integrations/inject-integration.js.map +1 -0
- package/dist/modules/features/agents/index.d.ts +3 -0
- package/dist/modules/features/agents/index.d.ts.map +1 -0
- package/dist/modules/features/agents/index.js +4 -0
- package/dist/modules/features/agents/index.js.map +1 -0
- package/dist/modules/features/agents/shared.d.ts +4 -0
- package/dist/modules/features/agents/shared.d.ts.map +1 -0
- package/dist/modules/features/agents/shared.js +21 -0
- package/dist/modules/features/agents/shared.js.map +1 -0
- package/dist/{configs/animations.d.ts → modules/features/animation/config.d.ts} +1 -1
- package/dist/modules/features/animation/config.d.ts.map +1 -0
- package/dist/{configs/animations.js → modules/features/animation/config.js} +1 -1
- package/dist/modules/features/animation/config.js.map +1 -0
- package/dist/modules/features/animation/gsap.d.ts +3 -0
- package/dist/modules/features/animation/gsap.d.ts.map +1 -0
- package/dist/modules/features/animation/gsap.js +16 -0
- package/dist/modules/features/animation/gsap.js.map +1 -0
- package/dist/modules/features/animation/index.d.ts +3 -0
- package/dist/modules/features/animation/index.d.ts.map +1 -0
- package/dist/modules/features/animation/index.js +4 -0
- package/dist/modules/features/animation/index.js.map +1 -0
- package/dist/modules/features/animation/motion.d.ts +3 -0
- package/dist/modules/features/animation/motion.d.ts.map +1 -0
- package/dist/modules/features/animation/motion.js +16 -0
- package/dist/modules/features/animation/motion.js.map +1 -0
- package/dist/modules/features/cms/index.d.ts +3 -0
- package/dist/modules/features/cms/index.d.ts.map +1 -0
- package/dist/modules/features/cms/index.js +7 -0
- package/dist/modules/features/cms/index.js.map +1 -0
- package/dist/modules/features/cms/sanity/config.d.ts.map +1 -0
- package/dist/{helpers/integrate → modules/features/cms}/sanity/config.js +3 -2
- package/dist/modules/features/cms/sanity/config.js.map +1 -0
- package/dist/modules/features/cms/sanity/index.d.ts +3 -0
- package/dist/modules/features/cms/sanity/index.d.ts.map +1 -0
- package/dist/modules/features/cms/sanity/index.js +61 -0
- package/dist/modules/features/cms/sanity/index.js.map +1 -0
- package/dist/{helpers/integrate/sanity/mergers/check-integration-merger.d.ts → modules/features/cms/sanity/mergers/check-integration.d.ts} +1 -1
- package/dist/modules/features/cms/sanity/mergers/check-integration.d.ts.map +1 -0
- package/dist/{helpers/integrate/sanity/mergers/check-integration-merger.js → modules/features/cms/sanity/mergers/check-integration.js} +1 -1
- package/dist/modules/features/cms/sanity/mergers/check-integration.js.map +1 -0
- package/dist/{helpers/integrate/sanity/mergers/layout-merger.d.ts → modules/features/cms/sanity/mergers/layout.d.ts} +1 -1
- package/dist/modules/features/cms/sanity/mergers/layout.d.ts.map +1 -0
- package/dist/{helpers/integrate/sanity/mergers/layout-merger.js → modules/features/cms/sanity/mergers/layout.js} +1 -1
- package/dist/modules/features/cms/sanity/mergers/layout.js.map +1 -0
- package/dist/modules/features/cms/sanity/mergers/sitemap.d.ts +13 -0
- package/dist/modules/features/cms/sanity/mergers/sitemap.d.ts.map +1 -0
- package/dist/modules/features/cms/sanity/mergers/sitemap.js +92 -0
- package/dist/modules/features/cms/sanity/mergers/sitemap.js.map +1 -0
- package/dist/modules/features/cms/sanity-pagebuilder/config.d.ts +14 -0
- package/dist/modules/features/cms/sanity-pagebuilder/config.d.ts.map +1 -0
- package/dist/modules/features/cms/sanity-pagebuilder/config.js +44 -0
- package/dist/modules/features/cms/sanity-pagebuilder/config.js.map +1 -0
- package/dist/modules/features/cms/sanity-pagebuilder/index.d.ts +3 -0
- package/dist/modules/features/cms/sanity-pagebuilder/index.d.ts.map +1 -0
- package/dist/modules/features/cms/sanity-pagebuilder/index.js +46 -0
- package/dist/modules/features/cms/sanity-pagebuilder/index.js.map +1 -0
- package/dist/modules/features/hooks/factory.d.ts +4 -0
- package/dist/modules/features/hooks/factory.d.ts.map +1 -0
- package/dist/modules/features/hooks/factory.js +26 -0
- package/dist/modules/features/hooks/factory.js.map +1 -0
- package/dist/modules/features/hooks/index.d.ts +3 -0
- package/dist/modules/features/hooks/index.d.ts.map +1 -0
- package/dist/modules/features/hooks/index.js +4 -0
- package/dist/modules/features/hooks/index.js.map +1 -0
- package/dist/modules/presets/index.d.ts +3 -0
- package/dist/modules/presets/index.d.ts.map +1 -0
- package/dist/modules/presets/index.js +11 -0
- package/dist/modules/presets/index.js.map +1 -0
- package/dist/modules/presets/next-default.d.ts +3 -0
- package/dist/modules/presets/next-default.d.ts.map +1 -0
- package/dist/modules/presets/next-default.js +9 -0
- package/dist/modules/presets/next-default.js.map +1 -0
- package/dist/modules/presets/next-experiments.d.ts +3 -0
- package/dist/modules/presets/next-experiments.d.ts.map +1 -0
- package/dist/modules/presets/next-experiments.js +9 -0
- package/dist/modules/presets/next-experiments.js.map +1 -0
- package/dist/modules/presets/next-pagebuilder.d.ts +3 -0
- package/dist/modules/presets/next-pagebuilder.d.ts.map +1 -0
- package/dist/modules/presets/next-pagebuilder.js +10 -0
- package/dist/modules/presets/next-pagebuilder.js.map +1 -0
- package/dist/modules/presets/next-webgl.d.ts +3 -0
- package/dist/modules/presets/next-webgl.d.ts.map +1 -0
- package/dist/modules/presets/next-webgl.js +9 -0
- package/dist/modules/presets/next-webgl.js.map +1 -0
- package/dist/paths.d.ts +7 -1
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +8 -2
- package/dist/paths.js.map +1 -1
- package/index.js +2 -2
- package/package.json +11 -4
- package/src/modules/features/cms/sanity/files/.knip.json +8 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/api/blog/[slug]/route.ts +3 -4
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/api/revalidate/route.ts +1 -4
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/blog/[slug]/page.tsx +8 -9
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/layout.tsx +2 -2
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/sitemap.md/route.ts +18 -29
- package/src/modules/features/cms/sanity/files/app/sitemap.xml/route.ts +51 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/env.ts +2 -4
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/queries.ts +0 -42
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schemas/index.ts +1 -1
- package/src/modules/features/cms/sanity/files/lib/scripts/copy-sanity-mcp.ts +23 -0
- package/src/modules/features/cms/sanity/files/lib/scripts/generate-page.ts +297 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/utils/json-ld.tsx +1 -6
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/utils/metadata.ts +2 -2
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/utils/url.ts +4 -2
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/proxy.ts +11 -11
- package/src/template-hooks/use-device-perf.ts +27 -17
- package/src/templates/next-default/.env.example +3 -3
- package/src/templates/next-default/.vscode/extensions.json +1 -5
- package/src/templates/next-default/.vscode/settings.json +1 -1
- package/src/templates/next-default/.zed/settings.json +47 -0
- package/src/templates/next-default/README.md +7 -6
- package/src/templates/next-default/_gitignore +1 -3
- package/src/templates/next-default/app/layout.tsx +21 -35
- package/src/templates/next-default/app/robots.ts +3 -4
- package/src/templates/next-default/app/sitemap.xml/route.ts +29 -29
- package/src/templates/next-default/biome.json +9 -2
- package/src/templates/next-default/components/ui/image/index.tsx +2 -1
- package/src/templates/next-default/components/ui/link/index.tsx +35 -35
- package/src/templates/next-default/lefthook.yml +25 -0
- package/src/templates/next-default/lib/README.md +8 -4
- package/src/templates/next-default/lib/hooks/use-media.ts +6 -3
- package/src/templates/next-default/lib/scripts/dev.ts +32 -0
- package/src/templates/next-default/lib/styles/README.md +13 -0
- package/src/templates/next-default/lib/styles/fonts.ts +20 -0
- package/src/templates/next-default/lib/styles/global.css +15 -196
- package/src/templates/next-default/lib/styles/index.css +3 -0
- package/src/templates/next-default/lib/styles/tokens.css +182 -0
- package/src/templates/next-default/lib/utils/README.md +40 -0
- package/src/templates/next-default/lib/utils/easings.ts +240 -0
- package/src/templates/next-default/lib/utils/fetch.ts +84 -0
- package/src/templates/next-default/lib/utils/global-css.d.ts +1 -0
- package/src/templates/next-default/lib/utils/json-ld.tsx +70 -68
- package/src/templates/next-default/lib/utils/math.ts +236 -0
- package/src/templates/next-default/lib/utils/metadata.ts +26 -27
- package/src/templates/next-default/lib/utils/strings.ts +246 -0
- package/src/templates/next-default/lib/utils/types.d.ts +15 -0
- package/src/templates/next-default/lib/utils/url.ts +8 -5
- package/src/templates/next-default/lib/utils/viewport.ts +199 -0
- package/src/templates/next-default/package.json +12 -7
- package/src/templates/next-default/svg.d.ts +1 -0
- package/src/templates/next-experiments/.env.example +3 -3
- package/src/templates/next-experiments/.knip.json +3 -0
- package/src/templates/next-experiments/.vscode/extensions.json +1 -5
- package/src/templates/next-experiments/.vscode/settings.json +1 -1
- package/src/templates/next-experiments/.zed/settings.json +47 -0
- package/src/templates/next-experiments/README.md +7 -6
- package/src/templates/next-experiments/_gitignore +1 -3
- package/src/templates/next-experiments/app/layout.tsx +21 -35
- package/src/templates/next-experiments/app/robots.ts +5 -2
- package/src/templates/next-experiments/app/sitemap.xml/route.ts +51 -0
- package/src/templates/next-experiments/biome.json +4 -2
- package/src/templates/next-experiments/components/layout/navigation-menu.tsx +1 -1
- package/src/templates/next-experiments/components/layout/wrapper/index.tsx +6 -6
- package/src/templates/next-experiments/components/ui/image/index.tsx +33 -33
- package/src/templates/next-experiments/lib/README.md +8 -4
- package/src/templates/next-experiments/lib/hooks/use-media.ts +6 -3
- package/src/templates/next-experiments/lib/scripts/dev.ts +32 -0
- package/src/templates/next-experiments/lib/styles/README.md +13 -0
- package/src/templates/next-experiments/lib/styles/fonts.ts +20 -0
- package/src/templates/next-experiments/lib/styles/global.css +16 -196
- package/src/templates/next-experiments/lib/styles/index.css +3 -0
- package/src/templates/next-experiments/lib/styles/tokens.css +182 -0
- package/src/templates/next-experiments/lib/utils/README.md +40 -0
- package/src/templates/next-experiments/lib/utils/easings.ts +240 -0
- package/src/templates/next-experiments/lib/utils/fetch.ts +84 -0
- package/src/templates/next-experiments/lib/utils/global-css.d.ts +1 -0
- package/src/templates/next-experiments/lib/utils/json-ld.tsx +70 -68
- package/src/templates/next-experiments/lib/utils/math.ts +236 -0
- package/src/templates/next-experiments/lib/utils/metadata.ts +26 -27
- package/src/templates/next-experiments/lib/utils/strings.ts +246 -0
- package/src/templates/next-experiments/lib/utils/types.d.ts +15 -0
- package/src/templates/next-experiments/lib/utils/url.ts +8 -5
- package/src/templates/next-experiments/lib/utils/viewport.ts +199 -0
- package/src/templates/next-experiments/package.json +6 -6
- package/src/templates/next-experiments/svg.d.ts +1 -0
- package/src/templates/next-pagebuilder/.vscode/extensions.json +16 -0
- package/src/templates/next-pagebuilder/.vscode/settings.json +105 -0
- package/src/templates/next-pagebuilder/.zed/settings.json +47 -0
- package/src/templates/next-pagebuilder/_gitignore +1 -3
- package/src/templates/next-pagebuilder/app/(content)/[[...slug]]/page.tsx +1 -1
- package/src/templates/next-pagebuilder/app/(content)/layout.tsx +0 -1
- package/src/templates/next-pagebuilder/app/robots.ts +3 -4
- package/src/templates/next-pagebuilder/biome.json +17 -0
- package/src/templates/next-pagebuilder/components/layout/footer/index.tsx +4 -5
- package/src/templates/next-pagebuilder/components/layout/header/index.tsx +1 -1
- package/src/templates/next-pagebuilder/components/page-builder/components/article-content/index.tsx +4 -9
- package/src/templates/next-pagebuilder/components/page-builder/components/article-content/related-post-item.tsx +4 -4
- package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/content-card.tsx +3 -1
- package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/index.tsx +12 -5
- package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/types.ts +3 -1
- package/src/templates/next-pagebuilder/components/page-builder/renderer.tsx +6 -2
- package/src/templates/next-pagebuilder/components/page-builder/types.ts +9 -7
- package/src/templates/next-pagebuilder/components/page-document/index.tsx +12 -2
- package/src/templates/next-pagebuilder/lefthook.yml +25 -0
- package/src/templates/next-pagebuilder/lib/integrations/sanity/sanity.types.ts +208 -0
- package/src/templates/next-pagebuilder/lib/styles/global.css +0 -1
- package/src/templates/next-pagebuilder/next.config.ts +0 -2
- package/src/templates/next-pagebuilder/package.json +13 -25
- package/src/templates/next-pagebuilder/postcss.config.mjs +27 -1
- package/src/templates/next-pagebuilder/svg.d.ts +1 -0
- package/src/templates/next-webgl/.env.example +3 -3
- package/src/templates/next-webgl/.vscode/extensions.json +1 -5
- package/src/templates/next-webgl/.vscode/settings.json +1 -1
- package/src/templates/next-webgl/.zed/settings.json +47 -0
- package/src/templates/next-webgl/README.md +7 -6
- package/src/templates/next-webgl/_gitignore +1 -3
- package/src/templates/next-webgl/app/layout.tsx +21 -35
- package/src/templates/next-webgl/app/robots.ts +3 -4
- package/src/templates/next-webgl/app/sitemap.xml/route.ts +29 -29
- package/src/templates/next-webgl/biome.json +9 -2
- package/src/templates/next-webgl/components/ui/image/index.tsx +2 -1
- package/src/templates/next-webgl/components/webgl/components/scene/index.tsx +0 -2
- package/src/templates/next-webgl/lefthook.yml +25 -0
- package/src/templates/next-webgl/lib/README.md +8 -4
- package/src/templates/next-webgl/lib/hooks/use-media.ts +6 -3
- package/src/templates/next-webgl/lib/scripts/dev.ts +32 -0
- package/src/templates/next-webgl/lib/styles/README.md +13 -0
- package/src/templates/next-webgl/lib/styles/fonts.ts +20 -0
- package/src/templates/next-webgl/lib/styles/global.css +16 -196
- package/src/templates/next-webgl/lib/styles/index.css +3 -0
- package/src/templates/next-webgl/lib/styles/tokens.css +182 -0
- package/src/templates/next-webgl/lib/utils/README.md +40 -0
- package/src/templates/next-webgl/lib/utils/easings.ts +240 -0
- package/src/templates/next-webgl/lib/utils/fetch.ts +84 -0
- package/src/templates/next-webgl/lib/utils/global-css.d.ts +1 -0
- package/src/templates/next-webgl/lib/utils/json-ld.tsx +70 -68
- package/src/templates/next-webgl/lib/utils/math.ts +236 -0
- package/src/templates/next-webgl/lib/utils/metadata.ts +26 -27
- package/src/templates/next-webgl/lib/utils/strings.ts +246 -0
- package/src/templates/next-webgl/lib/utils/types.d.ts +15 -0
- package/src/templates/next-webgl/lib/utils/url.ts +8 -5
- package/src/templates/next-webgl/lib/utils/viewport.ts +199 -0
- package/src/templates/next-webgl/package.json +13 -8
- package/src/templates/next-webgl/svg.d.ts +1 -0
- package/src/templates/next-webgl/tsconfig.tsbuildinfo +1 -1
- package/dist/configs/animations.d.ts.map +0 -1
- package/dist/configs/animations.js.map +0 -1
- package/dist/configs/skills.d.ts +0 -27
- package/dist/configs/skills.d.ts.map +0 -1
- package/dist/configs/skills.js +0 -18
- package/dist/configs/skills.js.map +0 -1
- package/dist/configs/skills.json +0 -26
- package/dist/helpers/add/hooks-config.d.ts +0 -22
- package/dist/helpers/add/hooks-config.d.ts.map +0 -1
- package/dist/helpers/add/hooks-config.js +0 -31
- package/dist/helpers/add/hooks-config.js.map +0 -1
- package/dist/helpers/add/index.d.ts.map +0 -1
- package/dist/helpers/add/index.js.map +0 -1
- package/dist/helpers/create/copy-template.d.ts +0 -11
- package/dist/helpers/create/copy-template.d.ts.map +0 -1
- package/dist/helpers/create/copy-template.js.map +0 -1
- package/dist/helpers/create/index.d.ts +0 -24
- package/dist/helpers/create/index.d.ts.map +0 -1
- package/dist/helpers/create/index.js +0 -99
- package/dist/helpers/create/index.js.map +0 -1
- package/dist/helpers/create/init-git.d.ts.map +0 -1
- package/dist/helpers/create/init-git.js.map +0 -1
- package/dist/helpers/create/install.d.ts.map +0 -1
- package/dist/helpers/create/install.js.map +0 -1
- package/dist/helpers/create/rename-files.d.ts.map +0 -1
- package/dist/helpers/create/rename-files.js.map +0 -1
- package/dist/helpers/create/setup-agent.d.ts.map +0 -1
- package/dist/helpers/create/setup-agent.js +0 -91
- package/dist/helpers/create/setup-agent.js.map +0 -1
- package/dist/helpers/create/setup-sanity.d.ts.map +0 -1
- package/dist/helpers/create/setup-sanity.js.map +0 -1
- package/dist/helpers/create/update-package.d.ts +0 -20
- package/dist/helpers/create/update-package.d.ts.map +0 -1
- package/dist/helpers/create/update-package.js +0 -97
- package/dist/helpers/create/update-package.js.map +0 -1
- package/dist/helpers/integrate/index.d.ts.map +0 -1
- package/dist/helpers/integrate/index.js.map +0 -1
- package/dist/helpers/integrate/merge-config.d.ts +0 -21
- package/dist/helpers/integrate/merge-config.d.ts.map +0 -1
- package/dist/helpers/integrate/merge-config.js +0 -42
- package/dist/helpers/integrate/merge-config.js.map +0 -1
- package/dist/helpers/integrate/merge-orchestrator.d.ts +0 -10
- package/dist/helpers/integrate/merge-orchestrator.d.ts.map +0 -1
- package/dist/helpers/integrate/merge-orchestrator.js.map +0 -1
- package/dist/helpers/integrate/sanity/config.d.ts.map +0 -1
- package/dist/helpers/integrate/sanity/config.js.map +0 -1
- package/dist/helpers/integrate/sanity/mergers/check-integration-merger.d.ts.map +0 -1
- package/dist/helpers/integrate/sanity/mergers/check-integration-merger.js.map +0 -1
- package/dist/helpers/integrate/sanity/mergers/layout-merger.d.ts.map +0 -1
- package/dist/helpers/integrate/sanity/mergers/layout-merger.js.map +0 -1
- package/dist/helpers/integrate/sanity/mergers/sitemap-merger.d.ts +0 -11
- package/dist/helpers/integrate/sanity/mergers/sitemap-merger.d.ts.map +0 -1
- package/dist/helpers/integrate/sanity/mergers/sitemap-merger.js +0 -133
- package/dist/helpers/integrate/sanity/mergers/sitemap-merger.js.map +0 -1
- package/dist/helpers/skills/index.d.ts.map +0 -1
- package/dist/helpers/skills/index.js.map +0 -1
- package/dist/utils/detect-project.d.ts.map +0 -1
- package/dist/utils/detect-project.js.map +0 -1
- package/dist/utils/format-results.d.ts.map +0 -1
- package/dist/utils/format-results.js.map +0 -1
- package/src/helpers/integrate/sanity/files/lib/integrations/sanity/WEBHOOK-SETUP.md +0 -74
- package/src/helpers/integrate/sanity/files/lib/integrations/sanity/sitemap.ts +0 -90
- package/src/template-hooks/config.js +0 -32
- package/src/templates/next-default/css.d.ts +0 -1
- package/src/templates/next-default/lib/utils/portable-text-to-markdown.ts +0 -83
- package/src/templates/next-default/tsconfig.tsbuildinfo +0 -1
- package/src/templates/next-experiments/css.d.ts +0 -1
- package/src/templates/next-experiments/lib/utils/portable-text-to-markdown.ts +0 -83
- package/src/templates/next-pagebuilder/app/api/[[...slug]]/route.ts +0 -100
- package/src/templates/next-pagebuilder/app/api/draft-mode/disable/route.ts +0 -7
- package/src/templates/next-pagebuilder/app/api/draft-mode/enable/route.ts +0 -20
- package/src/templates/next-pagebuilder/app/api/revalidate/route.ts +0 -121
- package/src/templates/next-pagebuilder/app/sitemap.md/route.ts +0 -124
- package/src/templates/next-pagebuilder/app/studio/[[...tool]]/page.tsx +0 -8
- package/src/templates/next-pagebuilder/components/sanity/draft-mode-toggle.tsx +0 -27
- package/src/templates/next-pagebuilder/components/sanity/rich-text.tsx +0 -87
- package/src/templates/next-pagebuilder/components/sanity/visual-editing.tsx +0 -28
- package/src/templates/next-pagebuilder/components/ui/sanity-image/index.tsx +0 -41
- package/src/templates/next-pagebuilder/lib/integrations/check-integration.ts +0 -5
- package/src/templates/next-pagebuilder/lib/integrations/sanity/client.ts +0 -27
- package/src/templates/next-pagebuilder/lib/integrations/sanity/components/disable-draft-mode.tsx +0 -23
- package/src/templates/next-pagebuilder/lib/integrations/sanity/components/page-builder-input.tsx +0 -36
- package/src/templates/next-pagebuilder/lib/integrations/sanity/components/page-category-input.tsx +0 -50
- package/src/templates/next-pagebuilder/lib/integrations/sanity/components/rich-text.tsx +0 -84
- package/src/templates/next-pagebuilder/lib/integrations/sanity/confirm-publish-action.ts +0 -40
- package/src/templates/next-pagebuilder/lib/integrations/sanity/constants.ts +0 -1
- package/src/templates/next-pagebuilder/lib/integrations/sanity/env.ts +0 -34
- package/src/templates/next-pagebuilder/lib/integrations/sanity/fetchers/layout.ts +0 -34
- package/src/templates/next-pagebuilder/lib/integrations/sanity/icons.ts +0 -58
- package/src/templates/next-pagebuilder/lib/integrations/sanity/live/index.tsx +0 -88
- package/src/templates/next-pagebuilder/lib/integrations/sanity/markdown-proxy.config.ts +0 -50
- package/src/templates/next-pagebuilder/lib/integrations/sanity/page-builder-config.ts +0 -132
- package/src/templates/next-pagebuilder/lib/integrations/sanity/page-category.ts +0 -28
- package/src/templates/next-pagebuilder/lib/integrations/sanity/presentation.ts +0 -118
- package/src/templates/next-pagebuilder/lib/integrations/sanity/queries.ts +0 -394
- package/src/templates/next-pagebuilder/lib/integrations/sanity/sanity.cli.ts +0 -29
- package/src/templates/next-pagebuilder/lib/integrations/sanity/sanity.config.ts +0 -116
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/components/index.ts +0 -4
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/components/reusable/blog-content.ts +0 -89
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/components/reusable/description.ts +0 -29
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/components/reusable/hero.ts +0 -28
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/components/singleton/content-collection.ts +0 -45
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/content/author.ts +0 -70
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/content/blog-category.ts +0 -55
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/index.ts +0 -96
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/layout/company-data.ts +0 -62
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/layout/footer.ts +0 -79
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/layout/navbar.ts +0 -74
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/link.ts +0 -125
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/logo-field.ts +0 -9
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/metadata.ts +0 -68
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/nav-objects.ts +0 -192
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/page-builder.ts +0 -39
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/page-folder.ts +0 -124
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/page.ts +0 -232
- package/src/templates/next-pagebuilder/lib/integrations/sanity/schemas/shared/richText.ts +0 -63
- package/src/templates/next-pagebuilder/lib/integrations/sanity/singletons.ts +0 -44
- package/src/templates/next-pagebuilder/lib/integrations/sanity/structure.ts +0 -453
- package/src/templates/next-pagebuilder/lib/integrations/sanity/utils/image.ts +0 -8
- package/src/templates/next-pagebuilder/lib/integrations/sanity/utils/link.ts +0 -137
- package/src/templates/next-pagebuilder/lib/integrations/sanity/utils/page-builder-markdown.ts +0 -81
- package/src/templates/next-pagebuilder/lib/scripts/sanity-typegen.ts +0 -45
- package/src/templates/next-pagebuilder/lib/utils/json-ld.tsx +0 -213
- package/src/templates/next-pagebuilder/lib/utils/metadata.ts +0 -167
- package/src/templates/next-pagebuilder/lib/utils/sitemap.ts +0 -37
- package/src/templates/next-pagebuilder/proxy.ts +0 -81
- package/src/templates/next-webgl/css.d.ts +0 -1
- package/src/templates/next-webgl/lib/utils/portable-text-to-markdown.ts +0 -83
- package/dist/{helpers → infrastructure}/create/copy-template.js +0 -0
- package/dist/{helpers → infrastructure}/create/rename-files.d.ts +0 -0
- package/dist/{helpers → infrastructure}/create/rename-files.js +0 -0
- package/dist/{helpers → infrastructure}/create/setup-sanity.d.ts +0 -0
- package/dist/{helpers/integrate → modules/features/cms}/sanity/config.d.ts +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/api/draft-mode/disable/route.ts +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/api/draft-mode/enable/route.ts +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/studio/[[...tool]]/page.tsx +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/app/studio/layout.tsx +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/components/ui/sanity-image/index.tsx +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/README.md +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/check-integration.ts +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/MARKDOWN-PROXY.md +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/README.md +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/client.ts +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/components/disable-draft-mode.tsx +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/components/rich-text.tsx +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/confirm-publish-action.ts +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/live/index.tsx +1 -1
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/markdown-proxy.config.ts +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/sanity.cli.ts +0 -0
- package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/sanity.config.ts +1 -1
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/sanity.types.ts +0 -0
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schema.json +0 -0
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schemas/article.ts +0 -0
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schemas/example.ts +0 -0
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schemas/link.ts +0 -0
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schemas/metadata.ts +0 -0
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schemas/navigation.ts +0 -0
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/schemas/richText.ts +0 -0
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/structure.ts +0 -0
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/utils/image.ts +0 -0
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/utils/link.ts +0 -0
- /package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/utils/portable-text-to-markdown.ts +0 -0
|
@@ -9,13 +9,13 @@ import { fontsVariable } from "@/lib/styles/fonts";
|
|
|
9
9
|
import AppData from "@/package.json";
|
|
10
10
|
import "@/lib/styles/css/index.css";
|
|
11
11
|
import { cn } from "@/lib/styles/cn";
|
|
12
|
-
import { getBaseUrl } from "@/lib/utils/url";
|
|
13
12
|
|
|
14
13
|
const APP_NAME = AppData.name;
|
|
15
14
|
const APP_DEFAULT_TITLE = "Basement Starter";
|
|
16
15
|
const APP_TITLE_TEMPLATE = "%s - Basement Starter";
|
|
17
16
|
const APP_DESCRIPTION = AppData.description;
|
|
18
|
-
const APP_BASE_URL =
|
|
17
|
+
const APP_BASE_URL =
|
|
18
|
+
process.env.NEXT_PUBLIC_BASE_URL ?? "http://localhost:3000";
|
|
19
19
|
|
|
20
20
|
const geist = Geist({
|
|
21
21
|
subsets: ["latin"],
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { NextResponse } from "next/server";
|
|
2
2
|
import { isSanityConfigured } from "@/lib/integrations/check-integration";
|
|
3
|
-
import { getBaseUrl } from "@/lib/utils/url";
|
|
4
|
-
|
|
5
|
-
export const dynamic = "force-dynamic";
|
|
6
3
|
|
|
7
4
|
export async function GET() {
|
|
8
|
-
const baseUrl =
|
|
5
|
+
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000";
|
|
9
6
|
|
|
10
7
|
if (!isSanityConfigured()) {
|
|
11
8
|
return new NextResponse(
|
|
@@ -17,13 +14,13 @@ export async function GET() {
|
|
|
17
14
|
}
|
|
18
15
|
|
|
19
16
|
try {
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
const sanityModule = await import("@/lib/integrations/sanity/client");
|
|
18
|
+
const sanityGroq = await import("next-sanity");
|
|
19
|
+
|
|
20
|
+
const client = sanityModule?.client;
|
|
21
|
+
const groq = sanityGroq?.groq;
|
|
25
22
|
|
|
26
|
-
if (!client) {
|
|
23
|
+
if (!(client && groq)) {
|
|
27
24
|
return new NextResponse("# Sitemap\n\nUnable to connect to CMS.", {
|
|
28
25
|
status: 503,
|
|
29
26
|
headers: { "Content-Type": "text/markdown; charset=utf-8" },
|
|
@@ -31,15 +28,18 @@ export async function GET() {
|
|
|
31
28
|
}
|
|
32
29
|
|
|
33
30
|
type SanityDoc = {
|
|
34
|
-
title
|
|
31
|
+
title: string;
|
|
35
32
|
slug: { current: string };
|
|
36
33
|
_updatedAt: string;
|
|
37
34
|
};
|
|
38
35
|
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
const articles = await client.fetch<SanityDoc[]>(
|
|
37
|
+
groq`*[_type == "article" && defined(slug.current)] | order(publishedAt desc) {
|
|
38
|
+
title,
|
|
39
|
+
slug,
|
|
40
|
+
_updatedAt
|
|
41
|
+
}`,
|
|
42
|
+
);
|
|
43
43
|
|
|
44
44
|
const parts = [
|
|
45
45
|
`# ${new URL(baseUrl).hostname} - Content Sitemap`,
|
|
@@ -52,26 +52,14 @@ export async function GET() {
|
|
|
52
52
|
if (articles.length > 0) {
|
|
53
53
|
parts.push("## Articles", "");
|
|
54
54
|
for (const article of articles) {
|
|
55
|
-
const title = article.title || article.slug.current;
|
|
56
|
-
parts.push(
|
|
57
|
-
`- [${title}](${baseUrl}/blog/${article.slug.current}.md)`,
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
parts.push("");
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (pages.length > 0) {
|
|
64
|
-
parts.push("## Pages", "");
|
|
65
|
-
for (const page of pages) {
|
|
66
|
-
const title = page.title || page.slug.current;
|
|
67
55
|
parts.push(
|
|
68
|
-
`- [${title}](${baseUrl}/${
|
|
56
|
+
`- [${article.title}](${baseUrl}/blog/${article.slug.current}.md)`,
|
|
69
57
|
);
|
|
70
58
|
}
|
|
71
59
|
parts.push("");
|
|
72
60
|
}
|
|
73
61
|
|
|
74
|
-
if (articles.length === 0
|
|
62
|
+
if (articles.length === 0) {
|
|
75
63
|
parts.push("No content published yet.", "");
|
|
76
64
|
}
|
|
77
65
|
|
|
@@ -81,6 +69,7 @@ export async function GET() {
|
|
|
81
69
|
headers: {
|
|
82
70
|
"Content-Type": "text/markdown; charset=utf-8",
|
|
83
71
|
"X-Content-Type-Options": "nosniff",
|
|
72
|
+
"Cache-Control": "public, s-maxage=3600, stale-while-revalidate=600",
|
|
84
73
|
},
|
|
85
74
|
});
|
|
86
75
|
} catch (error) {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { getBaseUrl } from "@/lib/utils/url";
|
|
2
|
+
|
|
3
|
+
const BASE_URL = getBaseUrl();
|
|
4
|
+
|
|
5
|
+
export const dynamic = "force-dynamic";
|
|
6
|
+
|
|
7
|
+
interface SitemapEntry {
|
|
8
|
+
loc: string;
|
|
9
|
+
lastmod: string;
|
|
10
|
+
changefreq: string;
|
|
11
|
+
priority: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function toXml(entries: SitemapEntry[]): string {
|
|
15
|
+
const urls = entries
|
|
16
|
+
.map(
|
|
17
|
+
(entry) => `
|
|
18
|
+
<url>
|
|
19
|
+
<loc>${entry.loc}</loc>
|
|
20
|
+
<lastmod>${entry.lastmod}</lastmod>
|
|
21
|
+
<changefreq>${entry.changefreq}</changefreq>
|
|
22
|
+
<priority>${entry.priority}</priority>
|
|
23
|
+
</url>`,
|
|
24
|
+
)
|
|
25
|
+
.join("");
|
|
26
|
+
|
|
27
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
28
|
+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">${urls}
|
|
29
|
+
</urlset>`;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function getStaticEntries(): SitemapEntry[] {
|
|
33
|
+
return [
|
|
34
|
+
{
|
|
35
|
+
loc: BASE_URL,
|
|
36
|
+
lastmod: new Date().toISOString(),
|
|
37
|
+
changefreq: "daily",
|
|
38
|
+
priority: 1,
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export async function GET() {
|
|
44
|
+
const entries: SitemapEntry[] = getStaticEntries();
|
|
45
|
+
|
|
46
|
+
return new Response(toXml(entries), {
|
|
47
|
+
headers: {
|
|
48
|
+
"Content-Type": "application/xml",
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
}
|
package/src/{helpers/integrate → modules/features/cms}/sanity/files/lib/integrations/sanity/env.ts
RENAMED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { getBaseUrl } from "@/lib/utils/url";
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* Sanity Environment Configuration
|
|
5
3
|
*
|
|
@@ -25,7 +23,7 @@ export const projectId =
|
|
|
25
23
|
export const studioUrl =
|
|
26
24
|
process.env.NODE_ENV === "development"
|
|
27
25
|
? "http://localhost:3000/studio"
|
|
28
|
-
: `${
|
|
26
|
+
: `${process.env.NEXT_PUBLIC_BASE_URL || ""}/studio`;
|
|
29
27
|
|
|
30
28
|
/**
|
|
31
29
|
* Single Sanity API read token used for both browser and server live preview.
|
|
@@ -41,4 +39,4 @@ export const sanityToken =
|
|
|
41
39
|
export const previewURL =
|
|
42
40
|
process.env.NODE_ENV === "development"
|
|
43
41
|
? "http://localhost:3000"
|
|
44
|
-
:
|
|
42
|
+
: process.env.NEXT_PUBLIC_BASE_URL || "";
|
|
@@ -64,45 +64,3 @@ export const ARTICLE_BY_ID_QUERY = defineQuery(`
|
|
|
64
64
|
_updatedAt
|
|
65
65
|
}
|
|
66
66
|
`);
|
|
67
|
-
|
|
68
|
-
export const PAGE_QUERY = defineQuery(`
|
|
69
|
-
*[_type == "example" && slug.current == $slug][0] {
|
|
70
|
-
_id,
|
|
71
|
-
title,
|
|
72
|
-
slug,
|
|
73
|
-
hero,
|
|
74
|
-
${richTextWithLinks},
|
|
75
|
-
features,
|
|
76
|
-
tags,
|
|
77
|
-
metadata,
|
|
78
|
-
publishedAt,
|
|
79
|
-
_updatedAt
|
|
80
|
-
}
|
|
81
|
-
`);
|
|
82
|
-
|
|
83
|
-
export const SITEMAP_ARTICLES_QUERY = defineQuery(`
|
|
84
|
-
*[_type == "article" && defined(slug.current)] {
|
|
85
|
-
title,
|
|
86
|
-
slug,
|
|
87
|
-
_updatedAt,
|
|
88
|
-
"noIndex": metadata.noIndex
|
|
89
|
-
}
|
|
90
|
-
`);
|
|
91
|
-
|
|
92
|
-
export const SITEMAP_PAGES_QUERY = defineQuery(`
|
|
93
|
-
*[_type == "example" && defined(slug.current)] {
|
|
94
|
-
title,
|
|
95
|
-
slug,
|
|
96
|
-
_updatedAt,
|
|
97
|
-
"noIndex": metadata.noIndex
|
|
98
|
-
}
|
|
99
|
-
`);
|
|
100
|
-
|
|
101
|
-
export const ALL_PAGES_QUERY = defineQuery(`
|
|
102
|
-
*[_type == "example" && defined(slug.current)] | order(publishedAt desc) {
|
|
103
|
-
slug,
|
|
104
|
-
_updatedAt,
|
|
105
|
-
"noIndex": metadata.noIndex
|
|
106
|
-
}
|
|
107
|
-
`);
|
|
108
|
-
|
|
@@ -15,7 +15,7 @@ import { navigation } from "./navigation";
|
|
|
15
15
|
import { richText } from "./richText";
|
|
16
16
|
|
|
17
17
|
// Re-export all schemas for convenience
|
|
18
|
-
export {
|
|
18
|
+
export { article, example, link, metadata, navigation, richText };
|
|
19
19
|
|
|
20
20
|
// Schema collection for Sanity configuration
|
|
21
21
|
export const schema: { types: SchemaTypeDefinition[] } = {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-platform Sanity MCP setup helper
|
|
3
|
+
* Copies the Cursor deeplink to clipboard on macOS/Linux/Windows
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { copyToClipboard } from "./utils";
|
|
7
|
+
|
|
8
|
+
const link =
|
|
9
|
+
"cursor://anysphere.cursor-deeplink/mcp/install?name=Sanity&config=eyJ1cmwiOiJodHRwczovL21jcC5zYW5pdHkuaW8iLCJ0eXBlIjoiaHR0cCJ9Cg==";
|
|
10
|
+
|
|
11
|
+
const copied = await copyToClipboard(link);
|
|
12
|
+
|
|
13
|
+
console.log("\n🔗 Sanity MCP Setup for Cursor\n");
|
|
14
|
+
|
|
15
|
+
if (copied) {
|
|
16
|
+
console.log("✅ Link copied to clipboard!");
|
|
17
|
+
console.log(" Paste it in your browser or Cursor address bar.\n");
|
|
18
|
+
} else {
|
|
19
|
+
console.log("📋 Copy this link manually:\n");
|
|
20
|
+
console.log(` ${link}\n`);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
console.log("This will install the Sanity MCP server in Cursor.");
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
/**
|
|
3
|
+
* Generate Page Module
|
|
4
|
+
*
|
|
5
|
+
* Generates new pages with pre-configured templates through interactive prompts.
|
|
6
|
+
* Used by the unified generator: `bun run generate`
|
|
7
|
+
*
|
|
8
|
+
* Cross-platform compatible (Windows, macOS, Linux)
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import * as p from "@clack/prompts";
|
|
12
|
+
import { createDir } from "./utils";
|
|
13
|
+
|
|
14
|
+
interface PageOptions {
|
|
15
|
+
webgl?: boolean;
|
|
16
|
+
sanity?: boolean;
|
|
17
|
+
theme?: string;
|
|
18
|
+
css?: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface PageConfig {
|
|
22
|
+
name: string;
|
|
23
|
+
options: PageOptions;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Interactive prompts for page configuration
|
|
28
|
+
*/
|
|
29
|
+
export const promptPageConfig = async (): Promise<PageConfig> => {
|
|
30
|
+
const name = await p.text({
|
|
31
|
+
message: "What should the page be called?",
|
|
32
|
+
placeholder: "about, contact, products",
|
|
33
|
+
validate: (value) => {
|
|
34
|
+
if (!value) return "Page name is required";
|
|
35
|
+
if (!/^[a-zA-Z][a-zA-Z0-9-_]*$/.test(value)) {
|
|
36
|
+
return "Page name must start with a letter and contain only letters, numbers, hyphens, and underscores";
|
|
37
|
+
}
|
|
38
|
+
return undefined;
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
if (p.isCancel(name)) {
|
|
43
|
+
p.cancel("Page generation cancelled");
|
|
44
|
+
process.exit(0);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const theme = await p.select({
|
|
48
|
+
message: "Choose a theme for the page",
|
|
49
|
+
options: [
|
|
50
|
+
{ value: "dark", label: "Dark (default)", hint: "Standard dark theme" },
|
|
51
|
+
{ value: "light", label: "Light", hint: "Light theme" },
|
|
52
|
+
{ value: "red", label: "Red", hint: "Red accent theme" },
|
|
53
|
+
],
|
|
54
|
+
initialValue: "dark",
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
if (p.isCancel(theme)) {
|
|
58
|
+
p.cancel("Page generation cancelled");
|
|
59
|
+
process.exit(0);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const integrations = await p.multiselect({
|
|
63
|
+
message: "Which integrations should this page use?",
|
|
64
|
+
options: [
|
|
65
|
+
{ value: "webgl", label: "WebGL Canvas", hint: "Enable 3D graphics" },
|
|
66
|
+
{ value: "sanity", label: "Sanity CMS", hint: "Content management" },
|
|
67
|
+
],
|
|
68
|
+
required: false,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
if (p.isCancel(integrations)) {
|
|
72
|
+
p.cancel("Page generation cancelled");
|
|
73
|
+
process.exit(0);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const includeCss = await p.confirm({
|
|
77
|
+
message: "Include a CSS module file?",
|
|
78
|
+
initialValue: false,
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
if (p.isCancel(includeCss)) {
|
|
82
|
+
p.cancel("Page generation cancelled");
|
|
83
|
+
process.exit(0);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return {
|
|
87
|
+
name,
|
|
88
|
+
options: {
|
|
89
|
+
theme,
|
|
90
|
+
webgl: integrations.includes("webgl"),
|
|
91
|
+
sanity: integrations.includes("sanity"),
|
|
92
|
+
css: includeCss,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Generate page.tsx content
|
|
99
|
+
*/
|
|
100
|
+
const generatePageContent = (
|
|
101
|
+
pageName: string,
|
|
102
|
+
options: PageOptions,
|
|
103
|
+
): string => {
|
|
104
|
+
const { webgl, sanity, theme = "dark" } = options;
|
|
105
|
+
|
|
106
|
+
// Capitalize first letter for title
|
|
107
|
+
const title = pageName.charAt(0).toUpperCase() + pageName.slice(1);
|
|
108
|
+
|
|
109
|
+
// Build imports
|
|
110
|
+
const imports: string[] = [];
|
|
111
|
+
imports.push(`import type { Metadata } from 'next'`);
|
|
112
|
+
imports.push(`import { Wrapper } from '@/components/layout/wrapper'`);
|
|
113
|
+
|
|
114
|
+
// Integration-specific imports
|
|
115
|
+
if (sanity) {
|
|
116
|
+
imports.push(
|
|
117
|
+
`import { NotConfigured } from '@/components/ui/not-configured'`,
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (sanity) {
|
|
122
|
+
imports.push(
|
|
123
|
+
`import { isSanityConfigured } from '@/lib/integrations/check-integration'`,
|
|
124
|
+
);
|
|
125
|
+
// sanityFetch and generateSanityMetadata are available for use:
|
|
126
|
+
// import { sanityFetch } from 'next-sanity/live'
|
|
127
|
+
// import { generateSanityMetadata } from '@/lib/utils/metadata'
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Build wrapper props
|
|
131
|
+
const wrapperProps: string[] = [`theme="${theme}"`];
|
|
132
|
+
if (webgl) {
|
|
133
|
+
wrapperProps.push("webgl");
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Build component body based on integrations
|
|
137
|
+
let componentBody: string;
|
|
138
|
+
|
|
139
|
+
if (sanity) {
|
|
140
|
+
// Sanity only
|
|
141
|
+
componentBody = ` // Show setup instructions if Sanity is not configured
|
|
142
|
+
if (!isSanityConfigured()) {
|
|
143
|
+
return (
|
|
144
|
+
<Wrapper theme="${theme}">
|
|
145
|
+
<NotConfigured integration="Sanity" />
|
|
146
|
+
</Wrapper>
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// TODO: Create a GROQ query for this page's content type
|
|
151
|
+
// const { data } = await sanityFetch({
|
|
152
|
+
// query: yourQuery,
|
|
153
|
+
// params: { slug: '${pageName}' },
|
|
154
|
+
// })
|
|
155
|
+
|
|
156
|
+
return (
|
|
157
|
+
<Wrapper ${wrapperProps.join(" ")}>
|
|
158
|
+
<section className="dr-py-100">
|
|
159
|
+
<div className="container">
|
|
160
|
+
<h1>${title}</h1>
|
|
161
|
+
{/* Your content here */}
|
|
162
|
+
{/* Fetch data from Sanity using a custom query */}
|
|
163
|
+
</div>
|
|
164
|
+
</section>
|
|
165
|
+
</Wrapper>
|
|
166
|
+
)`;
|
|
167
|
+
} else {
|
|
168
|
+
// No integrations
|
|
169
|
+
componentBody = ` return (
|
|
170
|
+
<Wrapper ${wrapperProps.join(" ")}>
|
|
171
|
+
<section className="dr-py-100">
|
|
172
|
+
<div className="container">
|
|
173
|
+
<h1>${title}</h1>
|
|
174
|
+
{/* Your content here */}
|
|
175
|
+
</div>
|
|
176
|
+
</section>
|
|
177
|
+
</Wrapper>
|
|
178
|
+
)`;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Build metadata export
|
|
182
|
+
let metadataExport: string;
|
|
183
|
+
if (sanity) {
|
|
184
|
+
metadataExport = `
|
|
185
|
+
export async function generateMetadata(): Promise<Metadata> {
|
|
186
|
+
if (!isSanityConfigured()) {
|
|
187
|
+
return {
|
|
188
|
+
title: '${title}',
|
|
189
|
+
description: '${title} page description',
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// TODO: Fetch metadata from Sanity using a custom query
|
|
194
|
+
// const { data } = await sanityFetch({
|
|
195
|
+
// query: yourQuery,
|
|
196
|
+
// params: { slug: '${pageName}' },
|
|
197
|
+
// })
|
|
198
|
+
|
|
199
|
+
return {
|
|
200
|
+
title: '${title}',
|
|
201
|
+
description: '${title} page description',
|
|
202
|
+
}
|
|
203
|
+
}`;
|
|
204
|
+
} else {
|
|
205
|
+
metadataExport = `
|
|
206
|
+
export const metadata: Metadata = {
|
|
207
|
+
title: '${title}',
|
|
208
|
+
description: '${title} page description',
|
|
209
|
+
}`;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// Determine if component should be async
|
|
213
|
+
const isAsync = sanity;
|
|
214
|
+
|
|
215
|
+
return `${imports.join("\n")}
|
|
216
|
+
${metadataExport}
|
|
217
|
+
|
|
218
|
+
export default ${isAsync ? "async " : ""}function ${title}Page() {
|
|
219
|
+
${componentBody}
|
|
220
|
+
}
|
|
221
|
+
`;
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Create page files and directories
|
|
226
|
+
*/
|
|
227
|
+
export const createPage = async (
|
|
228
|
+
pageName: string,
|
|
229
|
+
options: PageOptions,
|
|
230
|
+
): Promise<void> => {
|
|
231
|
+
const s = p.spinner();
|
|
232
|
+
|
|
233
|
+
try {
|
|
234
|
+
// Create directory structure
|
|
235
|
+
const pageDir = `app/${pageName}`;
|
|
236
|
+
const componentsDir = `${pageDir}/_components`;
|
|
237
|
+
|
|
238
|
+
s.start(`Creating page structure for "${pageName}"`);
|
|
239
|
+
|
|
240
|
+
// Create main page directory (cross-platform)
|
|
241
|
+
await createDir(pageDir);
|
|
242
|
+
|
|
243
|
+
// Create _components subdirectory (cross-platform)
|
|
244
|
+
await createDir(componentsDir);
|
|
245
|
+
|
|
246
|
+
// Create .gitkeep in _components
|
|
247
|
+
await Bun.write(`${componentsDir}/.gitkeep`, "");
|
|
248
|
+
|
|
249
|
+
// Generate and write page.tsx
|
|
250
|
+
const pageContent = generatePageContent(pageName, options);
|
|
251
|
+
await Bun.write(`${pageDir}/page.tsx`, pageContent);
|
|
252
|
+
|
|
253
|
+
// Create CSS module if requested
|
|
254
|
+
if (options.css) {
|
|
255
|
+
const cssContent = `/* ${pageName}.module.css */
|
|
256
|
+
|
|
257
|
+
.container {
|
|
258
|
+
/* Add your styles here */
|
|
259
|
+
}
|
|
260
|
+
`;
|
|
261
|
+
await Bun.write(`${pageDir}/${pageName}.module.css`, cssContent);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
s.stop(`Page "${pageName}" generated successfully!`);
|
|
265
|
+
|
|
266
|
+
// Show what was created
|
|
267
|
+
p.log.success(`Generated files:`);
|
|
268
|
+
p.log.message(` 📄 ${pageDir}/page.tsx`);
|
|
269
|
+
p.log.message(` 📁 ${componentsDir}/`);
|
|
270
|
+
if (options.css) {
|
|
271
|
+
p.log.message(` 🎨 ${pageDir}/${pageName}.module.css`);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// Build next steps message
|
|
275
|
+
const nextSteps = [`1. Customize ${pageDir}/page.tsx`];
|
|
276
|
+
|
|
277
|
+
if (options.sanity) {
|
|
278
|
+
nextSteps.push(
|
|
279
|
+
`2. Create a "${pageName}" page in Sanity Studio at /studio`,
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
nextSteps.push(
|
|
284
|
+
`${nextSteps.length + 1}. Add components to ${componentsDir}/`,
|
|
285
|
+
);
|
|
286
|
+
nextSteps.push(
|
|
287
|
+
`${nextSteps.length + 1}. Visit /${pageName} to see your page`,
|
|
288
|
+
);
|
|
289
|
+
|
|
290
|
+
p.note(`Next steps:\n ${nextSteps.join("\n ")}`);
|
|
291
|
+
} catch (error) {
|
|
292
|
+
s.stop(`Failed to generate page "${pageName}"`);
|
|
293
|
+
throw error;
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
// Export functions for use by unified generate script
|
|
@@ -9,7 +9,6 @@ import type {
|
|
|
9
9
|
WithContext,
|
|
10
10
|
} from "schema-dts";
|
|
11
11
|
|
|
12
|
-
|
|
13
12
|
const APP_BASE_URL = process.env.NEXT_PUBLIC_BASE_URL;
|
|
14
13
|
|
|
15
14
|
function isAbsoluteUrl(value: string) {
|
|
@@ -26,11 +25,7 @@ function resolveUrl(value?: string) {
|
|
|
26
25
|
|
|
27
26
|
/* -------------------------------- Component ------------------------------- */
|
|
28
27
|
|
|
29
|
-
export function JsonLd<T extends Thing>({
|
|
30
|
-
data,
|
|
31
|
-
}: {
|
|
32
|
-
data: WithContext<T>;
|
|
33
|
-
}) {
|
|
28
|
+
export function JsonLd<T extends Thing>({ data }: { data: WithContext<T> }) {
|
|
34
29
|
return (
|
|
35
30
|
<script
|
|
36
31
|
type="application/ld+json"
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Metadata } from "next";
|
|
2
|
-
import { getBaseUrl } from "@/lib/utils/url";
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* Metadata Generation Utilities
|
|
@@ -27,7 +26,8 @@ interface GenerateMetadataOptions {
|
|
|
27
26
|
authors?: string[];
|
|
28
27
|
}
|
|
29
28
|
|
|
30
|
-
const APP_BASE_URL =
|
|
29
|
+
const APP_BASE_URL =
|
|
30
|
+
process.env.NEXT_PUBLIC_BASE_URL ?? "http://localhost:3000";
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Generate complete metadata object for pages
|
|
@@ -8,10 +8,12 @@
|
|
|
8
8
|
* 4. localhost fallback
|
|
9
9
|
*/
|
|
10
10
|
export function getBaseUrl(): string {
|
|
11
|
-
if (process.env.NEXT_PUBLIC_BASE_URL)
|
|
11
|
+
if (process.env.NEXT_PUBLIC_BASE_URL) {
|
|
12
12
|
return process.env.NEXT_PUBLIC_BASE_URL;
|
|
13
|
-
|
|
13
|
+
}
|
|
14
|
+
if (process.env.VERCEL_PROJECT_PRODUCTION_URL) {
|
|
14
15
|
return `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`;
|
|
16
|
+
}
|
|
15
17
|
if (process.env.VERCEL_URL) return `https://${process.env.VERCEL_URL}`;
|
|
16
18
|
return "http://localhost:3000";
|
|
17
19
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { NextResponse } from "next/server";
|
|
2
1
|
import type { NextRequest } from "next/server";
|
|
2
|
+
import { NextResponse } from "next/server";
|
|
3
3
|
import {
|
|
4
|
-
mdExtensionRoutes,
|
|
5
4
|
acceptHeaderRoutes,
|
|
6
5
|
ignoredPaths,
|
|
6
|
+
mdExtensionRoutes,
|
|
7
7
|
} from "@/lib/integrations/sanity/markdown-proxy.config";
|
|
8
8
|
|
|
9
9
|
export function proxy(request: NextRequest) {
|
|
@@ -18,10 +18,10 @@ export function proxy(request: NextRequest) {
|
|
|
18
18
|
// e.g. /blog/my-post.md → /api/blog/my-post.md
|
|
19
19
|
for (const route of mdExtensionRoutes) {
|
|
20
20
|
const match = route.regex.exec(pathname);
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const slug = match?.[1];
|
|
22
|
+
if (slug) {
|
|
23
23
|
const url = request.nextUrl.clone();
|
|
24
|
-
url.pathname = route.apiPath.replace("[slug]", slug
|
|
24
|
+
url.pathname = route.apiPath.replace("[slug]", slug);
|
|
25
25
|
return NextResponse.rewrite(url);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -30,10 +30,10 @@ export function proxy(request: NextRequest) {
|
|
|
30
30
|
if (acceptHeader.includes("text/markdown")) {
|
|
31
31
|
for (const route of acceptHeaderRoutes) {
|
|
32
32
|
const match = route.regex.exec(pathname);
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
const slug = match?.[1];
|
|
34
|
+
if (slug) {
|
|
35
35
|
const url = request.nextUrl.clone();
|
|
36
|
-
url.pathname = route.apiPath.replace("[slug]", slug
|
|
36
|
+
url.pathname = route.apiPath.replace("[slug]", slug);
|
|
37
37
|
return NextResponse.rewrite(url);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -44,9 +44,9 @@ export function proxy(request: NextRequest) {
|
|
|
44
44
|
|
|
45
45
|
for (const route of acceptHeaderRoutes) {
|
|
46
46
|
const match = route.regex.exec(pathname);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const mdUrl = route.publicPath.replace("[slug]", slug
|
|
47
|
+
const slug = match?.[1];
|
|
48
|
+
if (slug) {
|
|
49
|
+
const mdUrl = route.publicPath.replace("[slug]", slug);
|
|
50
50
|
response.headers.set(
|
|
51
51
|
"Link",
|
|
52
52
|
`<${mdUrl}>; rel="alternate"; type="text/markdown"`,
|