kofi-stack-template-generator 2.1.37 → 2.1.38
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/.turbo/turbo-build.log +6 -6
- package/dist/index.js +8057 -440
- package/package.json +1 -1
- package/src/templates.generated.ts +248 -94
- package/templates/integrations/posthog/src/components/providers/posthog-provider.tsx.hbs +4 -1
- package/templates/marketing/payload/package.json.hbs +41 -26
- package/templates/marketing/payload/src/Footer/Component.client.tsx +288 -0
- package/templates/marketing/payload/src/Footer/Component.tsx +11 -0
- package/templates/marketing/payload/src/Footer/RowLabel.tsx +15 -0
- package/templates/marketing/payload/src/Footer/config.ts +178 -0
- package/templates/marketing/payload/src/Footer/hooks/{revalidateFooter.ts.hbs → revalidateFooter.ts} +5 -5
- package/templates/marketing/payload/src/Header/Component.client.tsx +94 -0
- package/templates/marketing/payload/src/Header/Component.tsx +10 -0
- package/templates/marketing/payload/src/Header/MegaMenu/index.tsx +197 -0
- package/templates/marketing/payload/src/Header/MobileMenu/HamburgerIcon.tsx +48 -0
- package/templates/marketing/payload/src/Header/MobileMenu/index.tsx +299 -0
- package/templates/marketing/payload/src/Header/Nav/index.tsx +76 -0
- package/templates/marketing/payload/src/Header/RowLabel.tsx +21 -0
- package/templates/marketing/payload/src/Header/config.ts +208 -0
- package/templates/marketing/payload/src/Header/hooks/{revalidateHeader.ts.hbs → revalidateHeader.ts} +5 -5
- package/templates/marketing/payload/src/access/{authenticated.ts.hbs → authenticated.ts} +1 -1
- package/templates/marketing/payload/src/access/{authenticatedOrPublished.ts.hbs → authenticatedOrPublished.ts} +8 -8
- package/templates/marketing/payload/src/app/(docs)/docs/[[...slug]]/page.tsx +117 -0
- package/templates/marketing/payload/src/app/(docs)/docs/layout.tsx +39 -0
- package/templates/marketing/payload/src/app/(docs)/layout.tsx +44 -0
- package/templates/marketing/payload/src/app/(frontend)/(sitemaps)/pages-sitemap.xml/route.ts +68 -0
- package/templates/marketing/payload/src/app/(frontend)/(sitemaps)/posts-sitemap.xml/route.ts +55 -0
- package/templates/marketing/payload/src/app/(frontend)/[slug]/page.client.tsx +15 -0
- package/templates/marketing/payload/src/app/(frontend)/[slug]/page.tsx +114 -0
- package/templates/marketing/payload/src/app/(frontend)/api/docs-search/route.ts +67 -0
- package/templates/marketing/payload/src/app/(frontend)/api/newsletter/route.ts +260 -0
- package/templates/marketing/payload/src/app/(frontend)/api/pricing/route.ts +266 -0
- package/templates/marketing/payload/src/app/(frontend)/globals.css +1019 -0
- package/templates/marketing/payload/src/app/(frontend)/layout.tsx +114 -0
- package/templates/marketing/payload/src/app/(frontend)/next/exit-preview/route.ts +7 -0
- package/templates/marketing/payload/src/app/(frontend)/next/preview/route.ts +56 -0
- package/templates/marketing/payload/src/app/(frontend)/next/seed/route.ts +31 -0
- package/templates/marketing/payload/src/app/(frontend)/not-found.tsx +17 -0
- package/templates/marketing/payload/src/app/(frontend)/page.tsx +5 -0
- package/templates/marketing/payload/src/app/(frontend)/posts/BlogPageClient.tsx +190 -0
- package/templates/marketing/payload/src/app/(frontend)/posts/[slug]/BlogPostContent.tsx +67 -0
- package/templates/marketing/payload/src/app/(frontend)/posts/[slug]/page.client.tsx +15 -0
- package/templates/marketing/payload/src/app/(frontend)/posts/[slug]/page.tsx +118 -0
- package/templates/marketing/payload/src/app/(frontend)/posts/page/[pageNumber]/page.client.tsx +15 -0
- package/templates/marketing/payload/src/app/(frontend)/posts/page/[pageNumber]/page.tsx +87 -0
- package/templates/marketing/payload/src/app/(frontend)/posts/page.tsx +49 -0
- package/templates/marketing/payload/src/app/(frontend)/search/page.client.tsx +15 -0
- package/templates/marketing/payload/src/app/(frontend)/search/page.tsx +87 -0
- package/templates/marketing/payload/src/app/(payload)/admin/[[...segments]]/not-found.tsx +24 -0
- package/templates/marketing/payload/src/app/(payload)/admin/[[...segments]]/page.tsx +24 -0
- package/templates/marketing/payload/src/app/(payload)/admin/importMap.js +83 -0
- package/templates/marketing/payload/src/app/(payload)/api/[...slug]/{route.ts.hbs → route.ts} +13 -9
- package/templates/marketing/payload/src/app/(payload)/api/graphql/{route.ts.hbs → route.ts} +2 -2
- package/templates/marketing/payload/src/app/(payload)/api/graphql-playground/{route.ts.hbs → route.ts} +3 -3
- package/templates/marketing/payload/src/app/(payload)/custom.scss +0 -0
- package/templates/marketing/payload/src/app/(payload)/layout.tsx +31 -0
- package/templates/marketing/payload/src/blocks/ArchiveBlock/Component.tsx +65 -0
- package/templates/marketing/payload/src/blocks/ArchiveBlock/config.ts +120 -0
- package/templates/marketing/payload/src/blocks/Banner/Component.tsx +26 -0
- package/templates/marketing/payload/src/blocks/Banner/config.ts +67 -0
- package/templates/marketing/payload/src/blocks/BentoFeatures/Component.tsx +243 -0
- package/templates/marketing/payload/src/blocks/BentoFeatures/config.ts +147 -0
- package/templates/marketing/payload/src/blocks/CallToAction/Component.tsx +31 -0
- package/templates/marketing/payload/src/blocks/CallToAction/config.ts +68 -0
- package/templates/marketing/payload/src/blocks/Code/Component.client.tsx +33 -0
- package/templates/marketing/payload/src/blocks/Code/Component.tsx +21 -0
- package/templates/marketing/payload/src/blocks/Code/CopyButton.tsx +33 -0
- package/templates/marketing/payload/src/blocks/Code/config.ts +33 -0
- package/templates/marketing/payload/src/blocks/Content/Component.tsx +41 -0
- package/templates/marketing/payload/src/blocks/Content/config.ts +105 -0
- package/templates/marketing/payload/src/blocks/FAQAccordion/Component.tsx +90 -0
- package/templates/marketing/payload/src/blocks/FAQAccordion/config.ts +75 -0
- package/templates/marketing/payload/src/blocks/FeatureGrid/Component.tsx +108 -0
- package/templates/marketing/payload/src/blocks/FeatureGrid/config.ts +109 -0
- package/templates/marketing/payload/src/blocks/FeatureShowcase/Component.tsx +107 -0
- package/templates/marketing/payload/src/blocks/FeatureShowcase/config.ts +111 -0
- package/templates/marketing/payload/src/blocks/FinalCTA/Component.tsx +117 -0
- package/templates/marketing/payload/src/blocks/FinalCTA/config.ts +50 -0
- package/templates/marketing/payload/src/blocks/Form/Checkbox/index.tsx +45 -0
- package/templates/marketing/payload/src/blocks/Form/Component.tsx +170 -0
- package/templates/marketing/payload/src/blocks/Form/Country/index.tsx +65 -0
- package/templates/marketing/payload/src/blocks/Form/Country/options.ts +982 -0
- package/templates/marketing/payload/src/blocks/Form/Email/index.tsx +38 -0
- package/templates/marketing/payload/src/blocks/Form/Error/index.tsx +13 -0
- package/templates/marketing/payload/src/blocks/Form/Message/index.tsx +13 -0
- package/templates/marketing/payload/src/blocks/Form/Number/index.tsx +36 -0
- package/templates/marketing/payload/src/blocks/Form/Select/index.tsx +63 -0
- package/templates/marketing/payload/src/blocks/Form/State/index.tsx +64 -0
- package/templates/marketing/payload/src/blocks/Form/State/options.ts +52 -0
- package/templates/marketing/payload/src/blocks/Form/Text/index.tsx +32 -0
- package/templates/marketing/payload/src/blocks/Form/Textarea/index.tsx +40 -0
- package/templates/marketing/payload/src/blocks/Form/Width/index.tsx +13 -0
- package/templates/marketing/payload/src/blocks/Form/config.ts +77 -0
- package/templates/marketing/payload/src/blocks/Form/fields.tsx +21 -0
- package/templates/marketing/payload/src/blocks/HowItWorks/Component.tsx +59 -0
- package/templates/marketing/payload/src/blocks/HowItWorks/config.ts +88 -0
- package/templates/marketing/payload/src/blocks/IndustryTabs/Component.tsx +132 -0
- package/templates/marketing/payload/src/blocks/IndustryTabs/config.ts +77 -0
- package/templates/marketing/payload/src/blocks/LogoBanner/Component.tsx +95 -0
- package/templates/marketing/payload/src/blocks/LogoBanner/config.ts +48 -0
- package/templates/marketing/payload/src/blocks/MediaBlock/Component.tsx +67 -0
- package/templates/marketing/payload/src/blocks/MediaBlock/config.ts +14 -0
- package/templates/marketing/payload/src/blocks/Personas/Component.tsx +69 -0
- package/templates/marketing/payload/src/blocks/Personas/config.ts +96 -0
- package/templates/marketing/payload/src/blocks/PricingTable/ComparisonTable.tsx +250 -0
- package/templates/marketing/payload/src/blocks/PricingTable/Component.tsx +443 -0
- package/templates/marketing/payload/src/blocks/PricingTable/config.ts +142 -0
- package/templates/marketing/payload/src/blocks/ProofBanner/Component.tsx +65 -0
- package/templates/marketing/payload/src/blocks/ProofBanner/config.ts +42 -0
- package/templates/marketing/payload/src/blocks/RelatedPosts/Component.tsx +32 -0
- package/templates/marketing/payload/src/blocks/RenderBlocks.tsx +92 -0
- package/templates/marketing/payload/src/blocks/TestimonialsGrid/Component.tsx +107 -0
- package/templates/marketing/payload/src/blocks/TestimonialsGrid/config.ts +76 -0
- package/templates/marketing/payload/src/blocks/TrustColumns/Component.tsx +83 -0
- package/templates/marketing/payload/src/blocks/TrustColumns/config.ts +70 -0
- package/templates/marketing/payload/src/collections/Categories.ts +28 -0
- package/templates/marketing/payload/src/collections/FAQs/index.ts +100 -0
- package/templates/marketing/payload/src/collections/Media.ts +160 -0
- package/templates/marketing/payload/src/collections/Pages/hooks/revalidatePage.ts +43 -0
- package/templates/marketing/payload/src/collections/Pages/index.ts +168 -0
- package/templates/marketing/payload/src/collections/Posts/hooks/populateAuthors.ts +41 -0
- package/templates/marketing/payload/src/collections/Posts/hooks/revalidatePost.ts +44 -0
- package/templates/marketing/payload/src/collections/Posts/index.ts +259 -0
- package/templates/marketing/payload/src/collections/Users/index.ts +26 -0
- package/templates/marketing/payload/src/components/AdminBar/index.scss +7 -0
- package/templates/marketing/payload/src/components/AdminBar/index.tsx +89 -0
- package/templates/marketing/payload/src/components/Analytics/CTATracker.tsx +33 -0
- package/templates/marketing/payload/src/components/Analytics/FeatureSectionTracker.tsx +47 -0
- package/templates/marketing/payload/src/components/Analytics/PricingViewTracker.tsx +46 -0
- package/templates/marketing/payload/src/components/Analytics/index.tsx +3 -0
- package/templates/marketing/payload/src/components/BeforeDashboard/SeedButton/index.tsx +89 -0
- package/templates/marketing/payload/src/components/BeforeDashboard/index.tsx +69 -0
- package/templates/marketing/payload/src/components/BeforeLogin/index.tsx +14 -0
- package/templates/marketing/payload/src/components/BlogCTA/index.tsx +77 -0
- package/templates/marketing/payload/src/components/Card/index.tsx +85 -0
- package/templates/marketing/payload/src/components/CollectionArchive/index.tsx +32 -0
- package/templates/marketing/payload/src/components/JsonLd/index.tsx +138 -0
- package/templates/marketing/payload/src/components/Link/index.tsx +66 -0
- package/templates/marketing/payload/src/components/LivePreviewListener/index.tsx +10 -0
- package/templates/marketing/payload/src/components/Logo/Logo.tsx +46 -0
- package/templates/marketing/payload/src/components/Media/ImageMedia/index.tsx +80 -0
- package/templates/marketing/payload/src/components/Media/VideoMedia/index.tsx +47 -0
- package/templates/marketing/payload/src/components/Media/index.tsx +26 -0
- package/templates/marketing/payload/src/components/Media/types.ts +22 -0
- package/templates/marketing/payload/src/components/PageRange/index.tsx +57 -0
- package/templates/marketing/payload/src/components/Pagination/index.tsx +101 -0
- package/templates/marketing/payload/src/components/PayloadRedirects/index.tsx +48 -0
- package/templates/marketing/payload/src/components/RichText/index.tsx +152 -0
- package/templates/marketing/payload/src/components/TableOfContents/index.tsx +128 -0
- package/templates/marketing/payload/src/components/ui/accordion.tsx +64 -0
- package/templates/marketing/payload/src/components/ui/button.tsx +52 -0
- package/templates/marketing/payload/src/components/ui/card.tsx +48 -0
- package/templates/marketing/payload/src/components/ui/checkbox.tsx +27 -0
- package/templates/marketing/payload/src/components/ui/input.tsx +22 -0
- package/templates/marketing/payload/src/components/ui/label.tsx +19 -0
- package/templates/marketing/payload/src/components/ui/pagination.tsx +92 -0
- package/templates/marketing/payload/src/components/ui/select.tsx +144 -0
- package/templates/marketing/payload/src/components/ui/textarea.tsx +21 -0
- package/templates/marketing/payload/src/endpoints/seed/contact-form.ts +111 -0
- package/templates/marketing/payload/src/endpoints/seed/contact-page.ts +56 -0
- package/templates/marketing/payload/src/endpoints/seed/directoryhub/about.ts +281 -0
- package/templates/marketing/payload/src/endpoints/seed/directoryhub/faqs.ts +224 -0
- package/templates/marketing/payload/src/endpoints/seed/directoryhub/features/automation.ts +229 -0
- package/templates/marketing/payload/src/endpoints/seed/directoryhub/features/custom-fields.ts +229 -0
- package/templates/marketing/payload/src/endpoints/seed/directoryhub/features/dashboard.ts +228 -0
- package/templates/marketing/payload/src/endpoints/seed/directoryhub/features/index.ts +6 -0
- package/templates/marketing/payload/src/endpoints/seed/directoryhub/features/monetization.ts +230 -0
- package/templates/marketing/payload/src/endpoints/seed/directoryhub/features/seo.ts +229 -0
- package/templates/marketing/payload/src/endpoints/seed/directoryhub/features/templates.ts +218 -0
- package/templates/marketing/payload/src/endpoints/seed/directoryhub/home.ts +555 -0
- package/templates/marketing/payload/src/endpoints/seed/directoryhub/index.ts +767 -0
- package/templates/marketing/payload/src/endpoints/seed/directoryhub/posts.ts +623 -0
- package/templates/marketing/payload/src/endpoints/seed/directoryhub/pricing.ts +251 -0
- package/templates/marketing/payload/src/endpoints/seed/directoryhub/privacy.ts +457 -0
- package/templates/marketing/payload/src/endpoints/seed/directoryhub/richtext-helper.ts +88 -0
- package/templates/marketing/payload/src/endpoints/seed/directoryhub/terms.ts +478 -0
- package/templates/marketing/payload/src/endpoints/seed/directoryhub/use-cases/b2b-vendor-hubs.ts +229 -0
- package/templates/marketing/payload/src/endpoints/seed/directoryhub/use-cases/communities.ts +230 -0
- package/templates/marketing/payload/src/endpoints/seed/directoryhub/use-cases/index.ts +4 -0
- package/templates/marketing/payload/src/endpoints/seed/directoryhub/use-cases/local-services.ts +230 -0
- package/templates/marketing/payload/src/endpoints/seed/directoryhub/use-cases/marketplaces.ts +230 -0
- package/templates/marketing/payload/src/endpoints/seed/home-static.ts +691 -0
- package/templates/marketing/payload/src/endpoints/seed/home.ts +675 -0
- package/templates/marketing/payload/src/endpoints/seed/image-1.ts +67 -0
- package/templates/marketing/payload/src/endpoints/seed/image-2.ts +67 -0
- package/templates/marketing/payload/src/endpoints/seed/image-3.ts +67 -0
- package/templates/marketing/payload/src/endpoints/seed/image-hero-1.ts +5 -0
- package/templates/marketing/payload/src/endpoints/seed/image-hero1.webp +0 -0
- package/templates/marketing/payload/src/endpoints/seed/image-post1.webp +0 -0
- package/templates/marketing/payload/src/endpoints/seed/image-post2.webp +0 -0
- package/templates/marketing/payload/src/endpoints/seed/image-post3.webp +0 -0
- package/templates/marketing/payload/src/endpoints/seed/index.ts +335 -0
- package/templates/marketing/payload/src/endpoints/seed/post-1.ts +315 -0
- package/templates/marketing/payload/src/endpoints/seed/post-2.ts +232 -0
- package/templates/marketing/payload/src/endpoints/seed/post-3.ts +268 -0
- package/templates/marketing/payload/src/fields/defaultLexical.ts +73 -0
- package/templates/marketing/payload/src/fields/link.ts +139 -0
- package/templates/marketing/payload/src/fields/linkGroup.ts +28 -0
- package/templates/marketing/payload/src/heros/HighImpact/index.tsx +56 -0
- package/templates/marketing/payload/src/heros/LowImpact/index.tsx +48 -0
- package/templates/marketing/payload/src/heros/MediumImpact/index.tsx +50 -0
- package/templates/marketing/payload/src/heros/PostHero/index.tsx +73 -0
- package/templates/marketing/payload/src/heros/ProductShowcase/AnimatedMockup.tsx +241 -0
- package/templates/marketing/payload/src/heros/ProductShowcase/index.tsx +108 -0
- package/templates/marketing/payload/src/heros/{RenderHero.tsx.hbs → RenderHero.tsx} +9 -9
- package/templates/marketing/payload/src/heros/config.ts +121 -0
- package/templates/marketing/payload/src/hooks/populatePublishedAt.ts +15 -0
- package/templates/marketing/payload/src/hooks/{revalidateRedirects.ts.hbs → revalidateRedirects.ts} +3 -3
- package/templates/marketing/payload/src/lib/convex.ts +13 -0
- package/templates/marketing/payload/src/lib/docs-source.ts +138 -0
- package/templates/marketing/payload/src/lib/mdx.tsx +191 -0
- package/templates/marketing/payload/src/payload.config.ts.hbs +95 -145
- package/templates/marketing/payload/src/plugins/index.ts +107 -0
- package/templates/marketing/payload/src/providers/HeaderTheme/index.tsx +34 -0
- package/templates/marketing/payload/src/providers/PostHogProvider.tsx +33 -0
- package/templates/marketing/payload/src/providers/Theme/InitTheme/{index.tsx.hbs → index.tsx} +11 -10
- package/templates/marketing/payload/src/providers/Theme/ThemeSelector/index.tsx +133 -0
- package/templates/marketing/payload/src/providers/Theme/ThemeSelector/types.ts +7 -0
- package/templates/marketing/payload/src/providers/Theme/index.tsx +60 -0
- package/templates/marketing/payload/src/providers/Theme/shared.ts +17 -0
- package/templates/marketing/payload/src/providers/Theme/{types.ts.hbs → types.ts} +3 -3
- package/templates/marketing/payload/src/providers/index.tsx +17 -0
- package/templates/marketing/payload/src/search/Component.tsx +42 -0
- package/templates/marketing/payload/src/search/beforeSync.ts +56 -0
- package/templates/marketing/payload/src/search/fieldOverrides.ts +61 -0
- package/templates/marketing/payload/src/utilities/deepMerge.ts +35 -0
- package/templates/marketing/payload/src/utilities/extractHeadings.ts +78 -0
- package/templates/marketing/payload/src/utilities/formatAuthors.ts +24 -0
- package/templates/marketing/payload/src/utilities/formatDateTime.ts +20 -0
- package/templates/marketing/payload/src/utilities/generateMeta.ts +93 -0
- package/templates/marketing/payload/src/utilities/generatePreviewPath.ts +33 -0
- package/templates/marketing/payload/src/utilities/getDocument.ts +32 -0
- package/templates/marketing/payload/src/utilities/getGlobals.ts +26 -0
- package/templates/marketing/payload/src/utilities/getMeUser.ts +43 -0
- package/templates/marketing/payload/src/utilities/getMediaUrl.ts +24 -0
- package/templates/marketing/payload/src/utilities/getRedirects.ts +26 -0
- package/templates/marketing/payload/src/utilities/getURL.ts +26 -0
- package/templates/marketing/payload/src/utilities/mergeOpenGraph.ts +26 -0
- package/templates/marketing/payload/src/utilities/toKebabCase.ts +5 -0
- package/templates/marketing/payload/src/utilities/ui.ts +12 -0
- package/templates/marketing/payload/src/utilities/useClickableCard.ts +108 -0
- package/templates/marketing/payload/src/utilities/useDebounce.ts +17 -0
- package/templates/packages/ui/src/components/button.tsx.hbs +53 -0
- package/templates/packages/ui/src/components/card.tsx.hbs +76 -0
- package/templates/packages/ui/src/components/separator.tsx.hbs +26 -0
- package/templates/marketing/payload/src/Footer/config.ts.hbs +0 -178
- package/templates/marketing/payload/src/Footer/index.ts.hbs +0 -1
- package/templates/marketing/payload/src/Header/RowLabel.tsx.hbs +0 -21
- package/templates/marketing/payload/src/Header/config.ts.hbs +0 -208
- package/templates/marketing/payload/src/Header/index.ts.hbs +0 -1
- package/templates/marketing/payload/src/access/index.ts.hbs +0 -3
- package/templates/marketing/payload/src/app/(frontend)/layout.tsx.hbs +0 -19
- package/templates/marketing/payload/src/app/(frontend)/next/seed/route.ts.hbs +0 -31
- package/templates/marketing/payload/src/app/(frontend)/page.tsx.hbs +0 -83
- package/templates/marketing/payload/src/app/(payload)/admin/[[...segments]]/not-found.tsx.hbs +0 -24
- package/templates/marketing/payload/src/app/(payload)/admin/[[...segments]]/page.tsx.hbs +0 -24
- package/templates/marketing/payload/src/app/(payload)/admin/importMap.js.hbs +0 -1
- package/templates/marketing/payload/src/app/(payload)/custom.scss.hbs +0 -1
- package/templates/marketing/payload/src/app/(payload)/layout.tsx.hbs +0 -31
- package/templates/marketing/payload/src/app/globals.css.hbs +0 -83
- package/templates/marketing/payload/src/app/layout.tsx.hbs +0 -10
- package/templates/marketing/payload/src/blocks/Benefits.ts.hbs +0 -34
- package/templates/marketing/payload/src/blocks/CTA.ts.hbs +0 -39
- package/templates/marketing/payload/src/blocks/Content.ts.hbs +0 -9
- package/templates/marketing/payload/src/blocks/FAQ.ts.hbs +0 -18
- package/templates/marketing/payload/src/blocks/Features.ts.hbs +0 -34
- package/templates/marketing/payload/src/blocks/Hero.ts.hbs +0 -40
- package/templates/marketing/payload/src/blocks/LogoBanner.ts.hbs +0 -17
- package/templates/marketing/payload/src/blocks/Pricing.ts.hbs +0 -37
- package/templates/marketing/payload/src/blocks/Testimonials.ts.hbs +0 -21
- package/templates/marketing/payload/src/blocks/index.ts.hbs +0 -9
- package/templates/marketing/payload/src/collections/Categories/index.ts.hbs +0 -28
- package/templates/marketing/payload/src/collections/FAQs/index.ts.hbs +0 -100
- package/templates/marketing/payload/src/collections/Media.ts.hbs +0 -164
- package/templates/marketing/payload/src/collections/Pages/hooks/revalidatePage.ts.hbs +0 -43
- package/templates/marketing/payload/src/collections/Pages/index.ts.hbs +0 -142
- package/templates/marketing/payload/src/collections/Posts/hooks/populateAuthors.ts.hbs +0 -41
- package/templates/marketing/payload/src/collections/Posts/hooks/revalidatePost.ts.hbs +0 -44
- package/templates/marketing/payload/src/collections/Posts/index.ts.hbs +0 -244
- package/templates/marketing/payload/src/collections/Users/index.ts.hbs +0 -26
- package/templates/marketing/payload/src/collections/index.ts.hbs +0 -6
- package/templates/marketing/payload/src/components/BeforeDashboard/SeedButton/index.tsx.hbs +0 -89
- package/templates/marketing/payload/src/components/BeforeDashboard/index.tsx.hbs +0 -69
- package/templates/marketing/payload/src/components/BeforeLogin/index.tsx.hbs +0 -14
- package/templates/marketing/payload/src/components/Link/index.tsx.hbs +0 -79
- package/templates/marketing/payload/src/components/Media/index.tsx.hbs +0 -67
- package/templates/marketing/payload/src/components/RichText/index.tsx.hbs +0 -44
- package/templates/marketing/payload/src/endpoints/seed/home.ts.hbs +0 -76
- package/templates/marketing/payload/src/endpoints/seed/image-1.ts.hbs +0 -5
- package/templates/marketing/payload/src/endpoints/seed/image-2.ts.hbs +0 -5
- package/templates/marketing/payload/src/endpoints/seed/image-hero.ts.hbs +0 -5
- package/templates/marketing/payload/src/endpoints/seed/index.ts.hbs +0 -235
- package/templates/marketing/payload/src/endpoints/seed/post-1.ts.hbs +0 -252
- package/templates/marketing/payload/src/fields/defaultLexical.ts.hbs +0 -73
- package/templates/marketing/payload/src/fields/link.ts.hbs +0 -139
- package/templates/marketing/payload/src/fields/linkGroup.ts.hbs +0 -28
- package/templates/marketing/payload/src/globals/index.ts.hbs +0 -2
- package/templates/marketing/payload/src/heros/HighImpact/index.tsx.hbs +0 -53
- package/templates/marketing/payload/src/heros/LowImpact/index.tsx.hbs +0 -48
- package/templates/marketing/payload/src/heros/MediumImpact/index.tsx.hbs +0 -46
- package/templates/marketing/payload/src/heros/PostHero/index.tsx.hbs +0 -68
- package/templates/marketing/payload/src/heros/ProductShowcase/index.tsx.hbs +0 -88
- package/templates/marketing/payload/src/heros/config.ts.hbs +0 -112
- package/templates/marketing/payload/src/heros/index.ts.hbs +0 -7
- package/templates/marketing/payload/src/hooks/index.ts.hbs +0 -2
- package/templates/marketing/payload/src/hooks/populatePublishedAt.ts.hbs +0 -15
- package/templates/marketing/payload/src/providers/HeaderTheme/index.tsx.hbs +0 -34
- package/templates/marketing/payload/src/providers/Theme/index.tsx.hbs +0 -60
- package/templates/marketing/payload/src/providers/Theme/shared.ts.hbs +0 -17
- package/templates/marketing/payload/src/providers/index.tsx.hbs +0 -18
- package/templates/marketing/payload/src/utilities/deepMerge.ts.hbs +0 -35
- package/templates/marketing/payload/src/utilities/formatAuthors.ts.hbs +0 -24
- package/templates/marketing/payload/src/utilities/formatDateTime.ts.hbs +0 -13
- package/templates/marketing/payload/src/utilities/generateMeta.ts.hbs +0 -87
- package/templates/marketing/payload/src/utilities/generatePreviewPath.ts.hbs +0 -33
- package/templates/marketing/payload/src/utilities/getURL.ts.hbs +0 -26
- package/templates/marketing/payload/src/utilities/index.ts.hbs +0 -8
- package/templates/marketing/payload/src/utilities/mergeOpenGraph.ts.hbs +0 -26
- /package/templates/marketing/payload/src/access/{anyone.ts.hbs → anyone.ts} +0 -0
- /package/templates/marketing/payload/src/components/BeforeDashboard/SeedButton/{index.scss.hbs → index.scss} +0 -0
- /package/templates/marketing/payload/src/components/BeforeDashboard/{index.scss.hbs → index.scss} +0 -0
- /package/templates/marketing/payload/src/fields/{index.ts.hbs → index.ts} +0 -0
- /package/templates/marketing/payload/src/utilities/{canUseDOM.ts.hbs → canUseDOM.ts} +0 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import React from "react"
|
|
4
|
+
|
|
5
|
+
import type { Header as HeaderType } from "@/payload-types"
|
|
6
|
+
|
|
7
|
+
import { CTATracker } from "@/components/Analytics"
|
|
8
|
+
import { CMSLink } from "@/components/Link"
|
|
9
|
+
import { MegaMenu } from "../MegaMenu"
|
|
10
|
+
|
|
11
|
+
type Position = "left" | "right"
|
|
12
|
+
|
|
13
|
+
interface HeaderNavProps {
|
|
14
|
+
data: HeaderType
|
|
15
|
+
position?: Position
|
|
16
|
+
className?: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const HeaderNav: React.FC<HeaderNavProps> = ({ data, position, className }) => {
|
|
20
|
+
const allNavItems = data?.navItems || []
|
|
21
|
+
|
|
22
|
+
// Filter items by position if specified
|
|
23
|
+
const navItems = position
|
|
24
|
+
? allNavItems.filter((item) => (item.position || "left") === position)
|
|
25
|
+
: allNavItems
|
|
26
|
+
|
|
27
|
+
if (navItems.length === 0) return null
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<nav className={className}>
|
|
31
|
+
{navItems.map((item, i) => {
|
|
32
|
+
const isRightPosition = (item.position || "left") === "right"
|
|
33
|
+
|
|
34
|
+
// Handle mega menu type
|
|
35
|
+
if (item.type === "megaMenu") {
|
|
36
|
+
return <MegaMenu key={item.id || i} item={item} />
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Handle simple link type
|
|
40
|
+
const link = item.link
|
|
41
|
+
if (!link) return null
|
|
42
|
+
|
|
43
|
+
// Determine appearance based on position and CMS setting
|
|
44
|
+
// Right-positioned items use their appearance setting (button = 'default', link = 'link')
|
|
45
|
+
// Left-positioned items always use link styling
|
|
46
|
+
const itemAppearance = item.appearance || "button"
|
|
47
|
+
const appearance = isRightPosition
|
|
48
|
+
? itemAppearance === "button"
|
|
49
|
+
? "default"
|
|
50
|
+
: "link"
|
|
51
|
+
: "link"
|
|
52
|
+
|
|
53
|
+
// Track CTA clicks for button-style items in the header
|
|
54
|
+
const isButton = appearance === "default"
|
|
55
|
+
const linkContent = (
|
|
56
|
+
<CMSLink
|
|
57
|
+
{...link}
|
|
58
|
+
label={item.label}
|
|
59
|
+
appearance={appearance}
|
|
60
|
+
className={appearance === "link" ? "text-sm font-medium" : undefined}
|
|
61
|
+
/>
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
if (isButton) {
|
|
65
|
+
return (
|
|
66
|
+
<CTATracker key={item.id || i} location="header" variant={item.label || `nav_${i}`}>
|
|
67
|
+
{linkContent}
|
|
68
|
+
</CTATracker>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return <React.Fragment key={item.id || i}>{linkContent}</React.Fragment>
|
|
73
|
+
})}
|
|
74
|
+
</nav>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
import type { Header } from "@/payload-types"
|
|
3
|
+
import { type RowLabelProps, useRowLabel } from "@payloadcms/ui"
|
|
4
|
+
|
|
5
|
+
export const RowLabel: React.FC<RowLabelProps> = () => {
|
|
6
|
+
const data = useRowLabel<NonNullable<Header["navItems"]>[number]>()
|
|
7
|
+
|
|
8
|
+
const itemLabel = data?.data?.label
|
|
9
|
+
const itemType = data?.data?.type === "megaMenu" ? "Mega Menu" : "Link"
|
|
10
|
+
const isRight = (data?.data?.position || "left") === "right"
|
|
11
|
+
const itemPosition = isRight ? "Right" : "Left"
|
|
12
|
+
const itemAppearance = isRight
|
|
13
|
+
? ` · ${(data?.data?.appearance || "button") === "button" ? "Button" : "Link"}`
|
|
14
|
+
: ""
|
|
15
|
+
|
|
16
|
+
const label = itemLabel
|
|
17
|
+
? `${data.rowNumber !== undefined ? data.rowNumber + 1 : ""}. ${itemLabel} — ${itemType} (${itemPosition}${itemAppearance})`
|
|
18
|
+
: "Row"
|
|
19
|
+
|
|
20
|
+
return <div>{label}</div>
|
|
21
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import type { GlobalConfig } from "payload"
|
|
2
|
+
|
|
3
|
+
import { link } from "@/fields/link"
|
|
4
|
+
import { revalidateHeader } from "./hooks/revalidateHeader"
|
|
5
|
+
|
|
6
|
+
export const Header: GlobalConfig = {
|
|
7
|
+
slug: "header",
|
|
8
|
+
access: {
|
|
9
|
+
read: () => true,
|
|
10
|
+
},
|
|
11
|
+
fields: [
|
|
12
|
+
{
|
|
13
|
+
name: "navItems",
|
|
14
|
+
type: "array",
|
|
15
|
+
maxRows: 8,
|
|
16
|
+
admin: {
|
|
17
|
+
initCollapsed: true,
|
|
18
|
+
components: {
|
|
19
|
+
RowLabel: "@/Header/RowLabel#RowLabel",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
fields: [
|
|
23
|
+
{
|
|
24
|
+
name: "type",
|
|
25
|
+
type: "select",
|
|
26
|
+
defaultValue: "link",
|
|
27
|
+
options: [
|
|
28
|
+
{ label: "Simple Link", value: "link" },
|
|
29
|
+
{ label: "Mega Menu", value: "megaMenu" },
|
|
30
|
+
],
|
|
31
|
+
admin: {
|
|
32
|
+
description: "Choose between a simple link or a mega menu dropdown",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: "label",
|
|
37
|
+
type: "text",
|
|
38
|
+
required: true,
|
|
39
|
+
label: "Nav Item Label",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "position",
|
|
43
|
+
type: "select",
|
|
44
|
+
defaultValue: "left",
|
|
45
|
+
options: [
|
|
46
|
+
{ label: "Left (Near Logo)", value: "left" },
|
|
47
|
+
{ label: "Right (CTA Section)", value: "right" },
|
|
48
|
+
],
|
|
49
|
+
admin: {
|
|
50
|
+
description: "Control where this nav item appears in the header",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "appearance",
|
|
55
|
+
type: "select",
|
|
56
|
+
defaultValue: "button",
|
|
57
|
+
options: [
|
|
58
|
+
{ label: "Button", value: "button" },
|
|
59
|
+
{ label: "Link", value: "link" },
|
|
60
|
+
],
|
|
61
|
+
admin: {
|
|
62
|
+
description: "How this item should be displayed",
|
|
63
|
+
condition: (_, siblingData) => siblingData?.position === "right",
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
// Simple link fields
|
|
67
|
+
link({
|
|
68
|
+
appearances: false,
|
|
69
|
+
disableLabel: true,
|
|
70
|
+
overrides: {
|
|
71
|
+
admin: {
|
|
72
|
+
condition: (_, siblingData) => siblingData?.type === "link",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
}),
|
|
76
|
+
// Mega menu fields
|
|
77
|
+
{
|
|
78
|
+
name: "megaMenuColumns",
|
|
79
|
+
type: "array",
|
|
80
|
+
label: "Menu Columns",
|
|
81
|
+
maxRows: 4,
|
|
82
|
+
admin: {
|
|
83
|
+
condition: (_, siblingData) => siblingData?.type === "megaMenu",
|
|
84
|
+
},
|
|
85
|
+
fields: [
|
|
86
|
+
{
|
|
87
|
+
name: "columnLabel",
|
|
88
|
+
type: "text",
|
|
89
|
+
label: "Column Heading",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: "columnDescription",
|
|
93
|
+
type: "textarea",
|
|
94
|
+
label: "Column Description",
|
|
95
|
+
admin: {
|
|
96
|
+
description: "Optional description shown below the column heading",
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: "items",
|
|
101
|
+
type: "array",
|
|
102
|
+
label: "Menu Items",
|
|
103
|
+
maxRows: 8,
|
|
104
|
+
fields: [
|
|
105
|
+
{
|
|
106
|
+
name: "label",
|
|
107
|
+
type: "text",
|
|
108
|
+
required: true,
|
|
109
|
+
label: "Item Label",
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: "description",
|
|
113
|
+
type: "text",
|
|
114
|
+
label: "Item Description",
|
|
115
|
+
admin: {
|
|
116
|
+
description: "Short description shown below the label",
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: "icon",
|
|
121
|
+
type: "select",
|
|
122
|
+
label: "Icon",
|
|
123
|
+
options: [
|
|
124
|
+
{ label: "None", value: "none" },
|
|
125
|
+
{ label: "Layout", value: "layout" },
|
|
126
|
+
{ label: "Dollar Sign", value: "dollarSign" },
|
|
127
|
+
{ label: "Search", value: "search" },
|
|
128
|
+
{ label: "Settings", value: "settings" },
|
|
129
|
+
{ label: "Zap", value: "zap" },
|
|
130
|
+
{ label: "Layers", value: "layers" },
|
|
131
|
+
{ label: "Users", value: "users" },
|
|
132
|
+
{ label: "Building", value: "building" },
|
|
133
|
+
{ label: "Globe", value: "globe" },
|
|
134
|
+
{ label: "Store", value: "store" },
|
|
135
|
+
{ label: "Rocket", value: "rocket" },
|
|
136
|
+
{ label: "Target", value: "target" },
|
|
137
|
+
{ label: "BarChart", value: "barChart" },
|
|
138
|
+
{ label: "Shield", value: "shield" },
|
|
139
|
+
{ label: "Database", value: "database" },
|
|
140
|
+
],
|
|
141
|
+
defaultValue: "none",
|
|
142
|
+
},
|
|
143
|
+
link({
|
|
144
|
+
appearances: false,
|
|
145
|
+
disableLabel: true,
|
|
146
|
+
}),
|
|
147
|
+
],
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
},
|
|
151
|
+
// Featured section for mega menu
|
|
152
|
+
{
|
|
153
|
+
name: "featuredItem",
|
|
154
|
+
type: "group",
|
|
155
|
+
label: "Featured Section",
|
|
156
|
+
admin: {
|
|
157
|
+
condition: (_, siblingData) => siblingData?.type === "megaMenu",
|
|
158
|
+
description: "Optional featured content shown in the mega menu",
|
|
159
|
+
},
|
|
160
|
+
fields: [
|
|
161
|
+
{
|
|
162
|
+
name: "enabled",
|
|
163
|
+
type: "checkbox",
|
|
164
|
+
label: "Show Featured Section",
|
|
165
|
+
defaultValue: false,
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: "heading",
|
|
169
|
+
type: "text",
|
|
170
|
+
label: "Featured Heading",
|
|
171
|
+
admin: {
|
|
172
|
+
condition: (_, siblingData) => siblingData?.enabled,
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: "description",
|
|
177
|
+
type: "textarea",
|
|
178
|
+
label: "Featured Description",
|
|
179
|
+
admin: {
|
|
180
|
+
condition: (_, siblingData) => siblingData?.enabled,
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: "image",
|
|
185
|
+
type: "upload",
|
|
186
|
+
relationTo: "media",
|
|
187
|
+
label: "Featured Image",
|
|
188
|
+
admin: {
|
|
189
|
+
condition: (_, siblingData) => siblingData?.enabled,
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
link({
|
|
193
|
+
appearances: false,
|
|
194
|
+
overrides: {
|
|
195
|
+
admin: {
|
|
196
|
+
condition: (_, siblingData) => siblingData?.enabled,
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
}),
|
|
200
|
+
],
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
},
|
|
204
|
+
],
|
|
205
|
+
hooks: {
|
|
206
|
+
afterChange: [revalidateHeader],
|
|
207
|
+
},
|
|
208
|
+
}
|
package/templates/marketing/payload/src/Header/hooks/{revalidateHeader.ts.hbs → revalidateHeader.ts}
RENAMED
|
@@ -3,11 +3,11 @@ import type { GlobalAfterChangeHook } from "payload"
|
|
|
3
3
|
import { revalidateTag } from "next/cache"
|
|
4
4
|
|
|
5
5
|
export const revalidateHeader: GlobalAfterChangeHook = ({ doc, req: { payload, context } }) => {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
if (!context.disableRevalidate) {
|
|
7
|
+
payload.logger.info("Revalidating header")
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
revalidateTag("global_header")
|
|
10
|
+
}
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
return doc
|
|
13
13
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { Access } from "payload"
|
|
2
2
|
|
|
3
3
|
export const authenticatedOrPublished: Access = ({ req: { user } }) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
if (user) {
|
|
5
|
+
return true
|
|
6
|
+
}
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
return {
|
|
9
|
+
_status: {
|
|
10
|
+
equals: "published",
|
|
11
|
+
},
|
|
12
|
+
}
|
|
13
13
|
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { getDocBySlug, getDocsFromConvex } from "@/lib/docs-source"
|
|
2
|
+
import { compileMDX } from "@/lib/mdx"
|
|
3
|
+
import { DocsBody, DocsDescription, DocsPage, DocsTitle } from "fumadocs-ui/page"
|
|
4
|
+
import type { Metadata } from "next"
|
|
5
|
+
import Link from "next/link"
|
|
6
|
+
import { notFound, redirect } from "next/navigation"
|
|
7
|
+
|
|
8
|
+
// Make this route dynamic so new docs appear immediately without rebuild
|
|
9
|
+
// This ensures docs added via admin portal show up right away
|
|
10
|
+
export const dynamic = "force-dynamic"
|
|
11
|
+
|
|
12
|
+
interface DocsPageProps {
|
|
13
|
+
params: Promise<{
|
|
14
|
+
slug?: string[]
|
|
15
|
+
}>
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default async function Page({ params }: DocsPageProps) {
|
|
19
|
+
const { slug } = await params
|
|
20
|
+
const slugPath = slug?.join("/") || ""
|
|
21
|
+
|
|
22
|
+
// If this is the index page (no slug), check for an "index" doc first
|
|
23
|
+
if (!slugPath) {
|
|
24
|
+
// Try to find a doc with slug "index" to use as the home page
|
|
25
|
+
const indexDoc = await getDocBySlug("index")
|
|
26
|
+
|
|
27
|
+
if (indexDoc) {
|
|
28
|
+
// Found an index doc, render it as the home page
|
|
29
|
+
const { content, toc } = await compileMDX(indexDoc.content)
|
|
30
|
+
return (
|
|
31
|
+
<DocsPage toc={toc}>
|
|
32
|
+
<DocsTitle>{indexDoc.title}</DocsTitle>
|
|
33
|
+
{indexDoc.description && <DocsDescription>{indexDoc.description}</DocsDescription>}
|
|
34
|
+
<DocsBody>{content}</DocsBody>
|
|
35
|
+
</DocsPage>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// No index doc found, check if there are other docs
|
|
40
|
+
const docs = await getDocsFromConvex()
|
|
41
|
+
|
|
42
|
+
// If there are docs, redirect to the first one
|
|
43
|
+
if (docs.length > 0 && docs[0]) {
|
|
44
|
+
redirect(`/docs/${docs[0].slug}`)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Otherwise show an empty state
|
|
48
|
+
return (
|
|
49
|
+
<DocsPage>
|
|
50
|
+
<DocsTitle>Documentation</DocsTitle>
|
|
51
|
+
<DocsDescription>Welcome to DirectoryHub documentation</DocsDescription>
|
|
52
|
+
<DocsBody>
|
|
53
|
+
<div className="flex flex-col items-center justify-center py-12 text-center">
|
|
54
|
+
<h2 className="text-xl font-semibold mb-4">No documentation yet</h2>
|
|
55
|
+
<p className="text-muted-foreground mb-6">
|
|
56
|
+
Documentation is coming soon. Check back later!
|
|
57
|
+
</p>
|
|
58
|
+
<Link
|
|
59
|
+
href="/"
|
|
60
|
+
className="inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90"
|
|
61
|
+
>
|
|
62
|
+
Back to Home
|
|
63
|
+
</Link>
|
|
64
|
+
</div>
|
|
65
|
+
</DocsBody>
|
|
66
|
+
</DocsPage>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Try to find the doc
|
|
71
|
+
const doc = await getDocBySlug(slugPath)
|
|
72
|
+
|
|
73
|
+
if (!doc) {
|
|
74
|
+
notFound()
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Compile MDX content
|
|
78
|
+
const { content, toc } = await compileMDX(doc.content)
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<DocsPage toc={toc}>
|
|
82
|
+
<DocsTitle>{doc.title}</DocsTitle>
|
|
83
|
+
{doc.description && <DocsDescription>{doc.description}</DocsDescription>}
|
|
84
|
+
<DocsBody>{content}</DocsBody>
|
|
85
|
+
</DocsPage>
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Removed generateStaticParams to make route fully dynamic
|
|
90
|
+
// This allows new docs to appear immediately without requiring a rebuild
|
|
91
|
+
// export async function generateStaticParams() {
|
|
92
|
+
// const slugs = await getAllDocSlugs()
|
|
93
|
+
// return [{ slug: [] }, ...slugs.map((slug) => ({ slug }))]
|
|
94
|
+
// }
|
|
95
|
+
|
|
96
|
+
export async function generateMetadata({ params }: DocsPageProps): Promise<Metadata> {
|
|
97
|
+
const { slug } = await params
|
|
98
|
+
const slugPath = slug?.join("/") || "index"
|
|
99
|
+
|
|
100
|
+
const doc = await getDocBySlug(slugPath)
|
|
101
|
+
|
|
102
|
+
if (!doc) {
|
|
103
|
+
return {
|
|
104
|
+
title: "Documentation | DirectoryHub",
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return {
|
|
109
|
+
title: `${doc.title} | DirectoryHub Docs`,
|
|
110
|
+
description: doc.description || `Learn about ${doc.title} in DirectoryHub documentation.`,
|
|
111
|
+
openGraph: {
|
|
112
|
+
title: `${doc.title} | DirectoryHub Docs`,
|
|
113
|
+
description: doc.description || `Learn about ${doc.title} in DirectoryHub documentation.`,
|
|
114
|
+
type: "article",
|
|
115
|
+
},
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { buildPageTree, getDocsFromConvex } from "@/lib/docs-source"
|
|
2
|
+
import { DocsLayout } from "fumadocs-ui/layouts/docs"
|
|
3
|
+
import { RootProvider } from "fumadocs-ui/provider"
|
|
4
|
+
import type { ReactNode } from "react"
|
|
5
|
+
|
|
6
|
+
// Make layout dynamic so navigation updates when new docs are added
|
|
7
|
+
export const dynamic = "force-dynamic"
|
|
8
|
+
|
|
9
|
+
export default async function DocsLayoutWrapper({
|
|
10
|
+
children,
|
|
11
|
+
}: {
|
|
12
|
+
children: ReactNode
|
|
13
|
+
}) {
|
|
14
|
+
const docs = await getDocsFromConvex()
|
|
15
|
+
const pageTree = buildPageTree(docs)
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<RootProvider
|
|
19
|
+
theme={{
|
|
20
|
+
enabled: true,
|
|
21
|
+
defaultTheme: "light",
|
|
22
|
+
attribute: "data-theme",
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
<DocsLayout
|
|
26
|
+
tree={pageTree}
|
|
27
|
+
nav={{
|
|
28
|
+
title: "DirectoryHub Docs",
|
|
29
|
+
url: "/docs",
|
|
30
|
+
}}
|
|
31
|
+
sidebar={{
|
|
32
|
+
defaultOpenLevel: 1,
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
{children}
|
|
36
|
+
</DocsLayout>
|
|
37
|
+
</RootProvider>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { getServerSideURL } from "@/utilities/getURL"
|
|
2
|
+
import { cn } from "@/utilities/ui"
|
|
3
|
+
import { GeistMono } from "geist/font/mono"
|
|
4
|
+
import type { Metadata } from "next"
|
|
5
|
+
import { Inter } from "next/font/google"
|
|
6
|
+
import type { ReactNode } from "react"
|
|
7
|
+
|
|
8
|
+
// Import both - globals.css for Tailwind base + fumadocs styles
|
|
9
|
+
import "../(frontend)/globals.css"
|
|
10
|
+
import "fumadocs-ui/style.css"
|
|
11
|
+
|
|
12
|
+
const inter = Inter({
|
|
13
|
+
subsets: ["latin"],
|
|
14
|
+
variable: "--font-inter",
|
|
15
|
+
display: "swap",
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
export default function DocsRootLayout({ children }: { children: ReactNode }) {
|
|
19
|
+
return (
|
|
20
|
+
<html
|
|
21
|
+
className={cn(inter.variable, GeistMono.variable)}
|
|
22
|
+
lang="en"
|
|
23
|
+
suppressHydrationWarning
|
|
24
|
+
data-theme="light"
|
|
25
|
+
>
|
|
26
|
+
<head>
|
|
27
|
+
<link href="/favicon.ico" rel="icon" sizes="32x32" />
|
|
28
|
+
<link href="/favicon.svg" rel="icon" type="image/svg+xml" />
|
|
29
|
+
</head>
|
|
30
|
+
<body className="font-sans antialiased" suppressHydrationWarning>
|
|
31
|
+
{children}
|
|
32
|
+
</body>
|
|
33
|
+
</html>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const metadata: Metadata = {
|
|
38
|
+
metadataBase: new URL(getServerSideURL()),
|
|
39
|
+
title: {
|
|
40
|
+
default: "Documentation | DirectoryHub",
|
|
41
|
+
template: "%s | DirectoryHub Docs",
|
|
42
|
+
},
|
|
43
|
+
description: "DirectoryHub documentation - learn how to build and manage directory websites.",
|
|
44
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import config from "@payload-config"
|
|
2
|
+
import { getServerSideSitemap } from "next-sitemap"
|
|
3
|
+
import { unstable_cache } from "next/cache"
|
|
4
|
+
import { getPayload } from "payload"
|
|
5
|
+
|
|
6
|
+
const getPagesSitemap = unstable_cache(
|
|
7
|
+
async () => {
|
|
8
|
+
const payload = await getPayload({ config })
|
|
9
|
+
const SITE_URL =
|
|
10
|
+
process.env.NEXT_PUBLIC_SERVER_URL ||
|
|
11
|
+
process.env.VERCEL_PROJECT_PRODUCTION_URL ||
|
|
12
|
+
"https://example.com"
|
|
13
|
+
|
|
14
|
+
const results = await payload.find({
|
|
15
|
+
collection: "pages",
|
|
16
|
+
overrideAccess: false,
|
|
17
|
+
draft: false,
|
|
18
|
+
depth: 0,
|
|
19
|
+
limit: 1000,
|
|
20
|
+
pagination: false,
|
|
21
|
+
where: {
|
|
22
|
+
_status: {
|
|
23
|
+
equals: "published",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
select: {
|
|
27
|
+
slug: true,
|
|
28
|
+
updatedAt: true,
|
|
29
|
+
},
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
const dateFallback = new Date().toISOString()
|
|
33
|
+
|
|
34
|
+
const defaultSitemap = [
|
|
35
|
+
{
|
|
36
|
+
loc: `${SITE_URL}/search`,
|
|
37
|
+
lastmod: dateFallback,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
loc: `${SITE_URL}/posts`,
|
|
41
|
+
lastmod: dateFallback,
|
|
42
|
+
},
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
const sitemap = results.docs
|
|
46
|
+
? results.docs
|
|
47
|
+
.filter((page) => Boolean(page?.slug))
|
|
48
|
+
.map((page) => {
|
|
49
|
+
return {
|
|
50
|
+
loc: page?.slug === "home" ? `${SITE_URL}/` : `${SITE_URL}/${page?.slug}`,
|
|
51
|
+
lastmod: page.updatedAt || dateFallback,
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
: []
|
|
55
|
+
|
|
56
|
+
return [...defaultSitemap, ...sitemap]
|
|
57
|
+
},
|
|
58
|
+
["pages-sitemap"],
|
|
59
|
+
{
|
|
60
|
+
tags: ["pages-sitemap"],
|
|
61
|
+
},
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
export async function GET() {
|
|
65
|
+
const sitemap = await getPagesSitemap()
|
|
66
|
+
|
|
67
|
+
return getServerSideSitemap(sitemap)
|
|
68
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import config from "@payload-config"
|
|
2
|
+
import { getServerSideSitemap } from "next-sitemap"
|
|
3
|
+
import { unstable_cache } from "next/cache"
|
|
4
|
+
import { getPayload } from "payload"
|
|
5
|
+
|
|
6
|
+
const getPostsSitemap = unstable_cache(
|
|
7
|
+
async () => {
|
|
8
|
+
const payload = await getPayload({ config })
|
|
9
|
+
const SITE_URL =
|
|
10
|
+
process.env.NEXT_PUBLIC_SERVER_URL ||
|
|
11
|
+
process.env.VERCEL_PROJECT_PRODUCTION_URL ||
|
|
12
|
+
"https://example.com"
|
|
13
|
+
|
|
14
|
+
const results = await payload.find({
|
|
15
|
+
collection: "posts",
|
|
16
|
+
overrideAccess: false,
|
|
17
|
+
draft: false,
|
|
18
|
+
depth: 0,
|
|
19
|
+
limit: 1000,
|
|
20
|
+
pagination: false,
|
|
21
|
+
where: {
|
|
22
|
+
_status: {
|
|
23
|
+
equals: "published",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
select: {
|
|
27
|
+
slug: true,
|
|
28
|
+
updatedAt: true,
|
|
29
|
+
},
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
const dateFallback = new Date().toISOString()
|
|
33
|
+
|
|
34
|
+
const sitemap = results.docs
|
|
35
|
+
? results.docs
|
|
36
|
+
.filter((post) => Boolean(post?.slug))
|
|
37
|
+
.map((post) => ({
|
|
38
|
+
loc: `${SITE_URL}/posts/${post?.slug}`,
|
|
39
|
+
lastmod: post.updatedAt || dateFallback,
|
|
40
|
+
}))
|
|
41
|
+
: []
|
|
42
|
+
|
|
43
|
+
return sitemap
|
|
44
|
+
},
|
|
45
|
+
["posts-sitemap"],
|
|
46
|
+
{
|
|
47
|
+
tags: ["posts-sitemap"],
|
|
48
|
+
},
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
export async function GET() {
|
|
52
|
+
const sitemap = await getPostsSitemap()
|
|
53
|
+
|
|
54
|
+
return getServerSideSitemap(sitemap)
|
|
55
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
import { useHeaderTheme } from "@/providers/HeaderTheme"
|
|
3
|
+
import React, { useEffect } from "react"
|
|
4
|
+
|
|
5
|
+
const PageClient: React.FC = () => {
|
|
6
|
+
/* Force the header to be dark mode while we have an image behind it */
|
|
7
|
+
const { setHeaderTheme } = useHeaderTheme()
|
|
8
|
+
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
setHeaderTheme("light")
|
|
11
|
+
}, [setHeaderTheme])
|
|
12
|
+
return <React.Fragment />
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default PageClient
|