kofi-stack-template-generator 2.1.36 → 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 +8059 -441
- package/package.json +1 -1
- package/src/templates.generated.ts +250 -95
- 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/package.json.hbs +4 -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/app/globals.css.hbs → packages/ui/src/styles.css.hbs} +39 -1
- 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/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 -32
- 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,138 @@
|
|
|
1
|
+
import { api } from "../../../../convex/_generated/api"
|
|
2
|
+
import { convex } from "./convex"
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Fetch published docs from Convex
|
|
6
|
+
*/
|
|
7
|
+
export async function getDocsFromConvex() {
|
|
8
|
+
try {
|
|
9
|
+
if (!process.env.NEXT_PUBLIC_CONVEX_URL) {
|
|
10
|
+
console.error(
|
|
11
|
+
"[Docs] NEXT_PUBLIC_CONVEX_URL environment variable is not set. Docs will not be available.",
|
|
12
|
+
)
|
|
13
|
+
return []
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const docs = await convex.query(api.docs.listPublished)
|
|
17
|
+
|
|
18
|
+
if (process.env.NODE_ENV === "development") {
|
|
19
|
+
console.log(`[Docs] Fetched ${docs.length} published document(s) from Convex`)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return docs
|
|
23
|
+
} catch (error) {
|
|
24
|
+
console.error("[Docs] Failed to fetch docs from Convex:", error)
|
|
25
|
+
return []
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Fetch a single doc by slug from Convex
|
|
31
|
+
*/
|
|
32
|
+
export async function getDocBySlug(slug: string) {
|
|
33
|
+
try {
|
|
34
|
+
if (!process.env.NEXT_PUBLIC_CONVEX_URL) {
|
|
35
|
+
console.error(
|
|
36
|
+
"[Docs] NEXT_PUBLIC_CONVEX_URL environment variable is not set. Docs will not be available.",
|
|
37
|
+
)
|
|
38
|
+
return null
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const doc = await convex.query(api.docs.getBySlug, { slug })
|
|
42
|
+
return doc
|
|
43
|
+
} catch (error) {
|
|
44
|
+
console.error(`[Docs] Failed to fetch doc "${slug}" from Convex:`, error)
|
|
45
|
+
return null
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Build page tree for navigation from docs
|
|
51
|
+
*/
|
|
52
|
+
export function buildPageTree(docs: Awaited<ReturnType<typeof getDocsFromConvex>>) {
|
|
53
|
+
// Sort docs by order, then alphabetically
|
|
54
|
+
const sortedDocs = [...docs].sort((a, b) => {
|
|
55
|
+
if (a.order !== undefined && b.order !== undefined) {
|
|
56
|
+
return a.order - b.order
|
|
57
|
+
}
|
|
58
|
+
if (a.order !== undefined) return -1
|
|
59
|
+
if (b.order !== undefined) return 1
|
|
60
|
+
return a.title.localeCompare(b.title)
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
// Group docs by parent
|
|
64
|
+
const topLevel = sortedDocs.filter((d) => !d.parentSlug)
|
|
65
|
+
const byParent = new Map<string, typeof sortedDocs>()
|
|
66
|
+
|
|
67
|
+
for (const doc of sortedDocs) {
|
|
68
|
+
if (doc.parentSlug) {
|
|
69
|
+
const existing = byParent.get(doc.parentSlug) || []
|
|
70
|
+
existing.push(doc)
|
|
71
|
+
byParent.set(doc.parentSlug, existing)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Build tree structure
|
|
76
|
+
const buildChildren = (parentSlug: string): PageTreeItem[] => {
|
|
77
|
+
const children = byParent.get(parentSlug) || []
|
|
78
|
+
return children.map((doc) => ({
|
|
79
|
+
type: "page" as const,
|
|
80
|
+
name: doc.title,
|
|
81
|
+
url: `/docs/${doc.slug}`,
|
|
82
|
+
children: buildChildren(doc.slug),
|
|
83
|
+
}))
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const tree: PageTreeItem[] = topLevel.map((doc) => {
|
|
87
|
+
const children = buildChildren(doc.slug)
|
|
88
|
+
if (children.length > 0) {
|
|
89
|
+
return {
|
|
90
|
+
type: "folder" as const,
|
|
91
|
+
name: doc.title,
|
|
92
|
+
index: {
|
|
93
|
+
type: "page" as const,
|
|
94
|
+
name: doc.title,
|
|
95
|
+
url: `/docs/${doc.slug}`,
|
|
96
|
+
},
|
|
97
|
+
children,
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
type: "page" as const,
|
|
102
|
+
name: doc.title,
|
|
103
|
+
url: `/docs/${doc.slug}`,
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
return {
|
|
108
|
+
name: "Documentation",
|
|
109
|
+
children: tree,
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Types for page tree
|
|
114
|
+
type PageTreeItem =
|
|
115
|
+
| {
|
|
116
|
+
type: "page"
|
|
117
|
+
name: string
|
|
118
|
+
url: string
|
|
119
|
+
children?: PageTreeItem[]
|
|
120
|
+
}
|
|
121
|
+
| {
|
|
122
|
+
type: "folder"
|
|
123
|
+
name: string
|
|
124
|
+
index?: { type: "page"; name: string; url: string }
|
|
125
|
+
children: PageTreeItem[]
|
|
126
|
+
}
|
|
127
|
+
| {
|
|
128
|
+
type: "separator"
|
|
129
|
+
name: string
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Get all page slugs for static generation
|
|
134
|
+
*/
|
|
135
|
+
export async function getAllDocSlugs(): Promise<string[][]> {
|
|
136
|
+
const docs = await getDocsFromConvex()
|
|
137
|
+
return docs.map((doc) => doc.slug.split("/"))
|
|
138
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { compile, run } from "@mdx-js/mdx"
|
|
2
|
+
import type { ReactNode } from "react"
|
|
3
|
+
import { createElement } from "react"
|
|
4
|
+
import * as runtime from "react/jsx-runtime"
|
|
5
|
+
|
|
6
|
+
interface TableOfContentsItem {
|
|
7
|
+
title: string
|
|
8
|
+
url: string
|
|
9
|
+
depth: number
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Compile MDX content to React components
|
|
14
|
+
*/
|
|
15
|
+
export async function compileMDX(source: string): Promise<{
|
|
16
|
+
content: ReactNode
|
|
17
|
+
toc: TableOfContentsItem[]
|
|
18
|
+
}> {
|
|
19
|
+
// Extract headings for TOC before compilation
|
|
20
|
+
const toc = extractTableOfContents(source)
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
// Compile MDX to JavaScript
|
|
24
|
+
const compiled = await compile(source, {
|
|
25
|
+
outputFormat: "function-body",
|
|
26
|
+
development: false,
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
// Run the compiled code
|
|
30
|
+
const { default: MDXContent } = await run(String(compiled), {
|
|
31
|
+
...runtime,
|
|
32
|
+
baseUrl: import.meta.url,
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
// Create the content element with custom components
|
|
36
|
+
const content = createElement(MDXContent, {
|
|
37
|
+
components: getMDXComponents(),
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
return { content, toc }
|
|
41
|
+
} catch (error) {
|
|
42
|
+
console.error("MDX compilation error:", error)
|
|
43
|
+
|
|
44
|
+
// Return a fallback with the raw content
|
|
45
|
+
return {
|
|
46
|
+
content: createElement(
|
|
47
|
+
"div",
|
|
48
|
+
{ className: "prose dark:prose-invert" },
|
|
49
|
+
createElement("p", { className: "text-red-500" }, "Error rendering content"),
|
|
50
|
+
createElement("pre", { className: "text-sm" }, source),
|
|
51
|
+
),
|
|
52
|
+
toc,
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Extract table of contents from markdown headings
|
|
59
|
+
*/
|
|
60
|
+
function extractTableOfContents(source: string): TableOfContentsItem[] {
|
|
61
|
+
const headingRegex = /^(#{1,6})\s+(.+)$/gm
|
|
62
|
+
const toc: TableOfContentsItem[] = []
|
|
63
|
+
|
|
64
|
+
const matches = source.matchAll(headingRegex)
|
|
65
|
+
for (const match of matches) {
|
|
66
|
+
const depth = match[1]?.length ?? 1
|
|
67
|
+
const title = match[2]?.trim() ?? ""
|
|
68
|
+
|
|
69
|
+
// Create URL-friendly slug
|
|
70
|
+
const url = `#${title
|
|
71
|
+
.toLowerCase()
|
|
72
|
+
.replace(/[^a-z0-9\s-]/g, "")
|
|
73
|
+
.replace(/\s+/g, "-")}`
|
|
74
|
+
|
|
75
|
+
toc.push({ title, url, depth })
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return toc
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Custom MDX components for styling
|
|
83
|
+
*/
|
|
84
|
+
function getMDXComponents() {
|
|
85
|
+
return {
|
|
86
|
+
h1: (props: React.HTMLAttributes<HTMLHeadingElement>) =>
|
|
87
|
+
createElement("h1", {
|
|
88
|
+
...props,
|
|
89
|
+
className: "scroll-m-20 text-4xl font-bold tracking-tight",
|
|
90
|
+
id: slugify(String(props.children)),
|
|
91
|
+
}),
|
|
92
|
+
h2: (props: React.HTMLAttributes<HTMLHeadingElement>) =>
|
|
93
|
+
createElement("h2", {
|
|
94
|
+
...props,
|
|
95
|
+
className:
|
|
96
|
+
"scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0 mt-10",
|
|
97
|
+
id: slugify(String(props.children)),
|
|
98
|
+
}),
|
|
99
|
+
h3: (props: React.HTMLAttributes<HTMLHeadingElement>) =>
|
|
100
|
+
createElement("h3", {
|
|
101
|
+
...props,
|
|
102
|
+
className: "scroll-m-20 text-2xl font-semibold tracking-tight mt-8",
|
|
103
|
+
id: slugify(String(props.children)),
|
|
104
|
+
}),
|
|
105
|
+
h4: (props: React.HTMLAttributes<HTMLHeadingElement>) =>
|
|
106
|
+
createElement("h4", {
|
|
107
|
+
...props,
|
|
108
|
+
className: "scroll-m-20 text-xl font-semibold tracking-tight mt-6",
|
|
109
|
+
id: slugify(String(props.children)),
|
|
110
|
+
}),
|
|
111
|
+
p: (props: React.HTMLAttributes<HTMLParagraphElement>) =>
|
|
112
|
+
createElement("p", {
|
|
113
|
+
...props,
|
|
114
|
+
className: "leading-7 [&:not(:first-child)]:mt-6",
|
|
115
|
+
}),
|
|
116
|
+
ul: (props: React.HTMLAttributes<HTMLUListElement>) =>
|
|
117
|
+
createElement("ul", {
|
|
118
|
+
...props,
|
|
119
|
+
className: "my-6 ml-6 list-disc [&>li]:mt-2",
|
|
120
|
+
}),
|
|
121
|
+
ol: (props: React.HTMLAttributes<HTMLOListElement>) =>
|
|
122
|
+
createElement("ol", {
|
|
123
|
+
...props,
|
|
124
|
+
className: "my-6 ml-6 list-decimal [&>li]:mt-2",
|
|
125
|
+
}),
|
|
126
|
+
li: (props: React.HTMLAttributes<HTMLLIElement>) => createElement("li", { ...props }),
|
|
127
|
+
blockquote: (props: React.HTMLAttributes<HTMLQuoteElement>) =>
|
|
128
|
+
createElement("blockquote", {
|
|
129
|
+
...props,
|
|
130
|
+
className: "mt-6 border-l-2 pl-6 italic",
|
|
131
|
+
}),
|
|
132
|
+
code: (props: React.HTMLAttributes<HTMLElement>) => {
|
|
133
|
+
// Check if this is an inline code or a code block
|
|
134
|
+
const isInline = typeof props.children === "string"
|
|
135
|
+
if (isInline) {
|
|
136
|
+
return createElement("code", {
|
|
137
|
+
...props,
|
|
138
|
+
className:
|
|
139
|
+
"relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold",
|
|
140
|
+
})
|
|
141
|
+
}
|
|
142
|
+
return createElement("code", { ...props })
|
|
143
|
+
},
|
|
144
|
+
pre: (props: React.HTMLAttributes<HTMLPreElement>) =>
|
|
145
|
+
createElement("pre", {
|
|
146
|
+
...props,
|
|
147
|
+
className: "mb-4 mt-6 overflow-x-auto rounded-lg border bg-zinc-950 py-4 dark:bg-zinc-900",
|
|
148
|
+
}),
|
|
149
|
+
a: (props: React.AnchorHTMLAttributes<HTMLAnchorElement>) =>
|
|
150
|
+
createElement("a", {
|
|
151
|
+
...props,
|
|
152
|
+
className: "font-medium text-primary underline underline-offset-4",
|
|
153
|
+
}),
|
|
154
|
+
table: (props: React.HTMLAttributes<HTMLTableElement>) =>
|
|
155
|
+
createElement(
|
|
156
|
+
"div",
|
|
157
|
+
{ className: "my-6 w-full overflow-y-auto" },
|
|
158
|
+
createElement("table", { ...props, className: "w-full" }),
|
|
159
|
+
),
|
|
160
|
+
tr: (props: React.HTMLAttributes<HTMLTableRowElement>) =>
|
|
161
|
+
createElement("tr", {
|
|
162
|
+
...props,
|
|
163
|
+
className: "m-0 border-t p-0 even:bg-muted",
|
|
164
|
+
}),
|
|
165
|
+
th: (props: React.HTMLAttributes<HTMLTableCellElement>) =>
|
|
166
|
+
createElement("th", {
|
|
167
|
+
...props,
|
|
168
|
+
className:
|
|
169
|
+
"border px-4 py-2 text-left font-bold [&[align=center]]:text-center [&[align=right]]:text-right",
|
|
170
|
+
}),
|
|
171
|
+
td: (props: React.HTMLAttributes<HTMLTableCellElement>) =>
|
|
172
|
+
createElement("td", {
|
|
173
|
+
...props,
|
|
174
|
+
className:
|
|
175
|
+
"border px-4 py-2 text-left [&[align=center]]:text-center [&[align=right]]:text-right",
|
|
176
|
+
}),
|
|
177
|
+
hr: () => createElement("hr", { className: "my-4 md:my-8" }),
|
|
178
|
+
img: (props: React.ImgHTMLAttributes<HTMLImageElement>) =>
|
|
179
|
+
createElement("img", {
|
|
180
|
+
...props,
|
|
181
|
+
className: "rounded-md border",
|
|
182
|
+
}),
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function slugify(text: string): string {
|
|
187
|
+
return text
|
|
188
|
+
.toLowerCase()
|
|
189
|
+
.replace(/[^a-z0-9\s-]/g, "")
|
|
190
|
+
.replace(/\s+/g, "-")
|
|
191
|
+
}
|
|
@@ -1,150 +1,100 @@
|
|
|
1
|
-
import path from
|
|
2
|
-
import { fileURLToPath } from
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import sharp from 'sharp'
|
|
9
|
-
{{#if (eq integrations.payloadStorage 's3')}}
|
|
10
|
-
import { s3Storage } from '@payloadcms/storage-s3'
|
|
11
|
-
{{/if}}
|
|
12
|
-
{{#if (eq integrations.payloadStorage 'r2')}}
|
|
13
|
-
import { s3Storage } from '@payloadcms/storage-s3'
|
|
14
|
-
{{/if}}
|
|
15
|
-
{{#if (eq integrations.payloadStorage 'vercel-blob')}}
|
|
16
|
-
import { vercelBlobStorage } from '@payloadcms/storage-vercel-blob'
|
|
17
|
-
{{/if}}
|
|
18
|
-
{{#if (eq integrations.payloadStorage 'gcs')}}
|
|
19
|
-
import { gcsStorage } from '@payloadcms/storage-gcs'
|
|
20
|
-
{{/if}}
|
|
1
|
+
import path from "node:path"
|
|
2
|
+
import { fileURLToPath } from "node:url"
|
|
3
|
+
import { postgresAdapter } from "@payloadcms/db-postgres"
|
|
4
|
+
import { resendAdapter } from "@payloadcms/email-resend"
|
|
5
|
+
import type { SharpDependency } from "payload"
|
|
6
|
+
import { type PayloadRequest, buildConfig } from "payload"
|
|
7
|
+
import sharp from "sharp"
|
|
21
8
|
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
9
|
+
import { defaultLexical } from "@/fields/defaultLexical"
|
|
10
|
+
import { Footer } from "./Footer/config"
|
|
11
|
+
import { Header } from "./Header/config"
|
|
12
|
+
import { Categories } from "./collections/Categories"
|
|
13
|
+
import { FAQs } from "./collections/FAQs"
|
|
14
|
+
import { Media } from "./collections/Media"
|
|
15
|
+
import { Pages } from "./collections/Pages"
|
|
16
|
+
import { Posts } from "./collections/Posts"
|
|
17
|
+
import { Users } from "./collections/Users"
|
|
18
|
+
import { plugins } from "./plugins"
|
|
19
|
+
import { getServerSideURL } from "./utilities/getURL"
|
|
25
20
|
|
|
26
|
-
const
|
|
27
|
-
const
|
|
21
|
+
const filename = fileURLToPath(import.meta.url)
|
|
22
|
+
const dirname = path.dirname(filename)
|
|
28
23
|
|
|
29
24
|
export default buildConfig({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
{{
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
endpoint: process.env.R2_ENDPOINT!,
|
|
106
|
-
forcePathStyle: true,
|
|
107
|
-
},
|
|
108
|
-
}),
|
|
109
|
-
{{/if}}
|
|
110
|
-
{{#if (eq integrations.payloadStorage 'vercel-blob')}}
|
|
111
|
-
vercelBlobStorage({
|
|
112
|
-
collections: {
|
|
113
|
-
media: true,
|
|
114
|
-
},
|
|
115
|
-
token: process.env.BLOB_READ_WRITE_TOKEN!,
|
|
116
|
-
}),
|
|
117
|
-
{{/if}}
|
|
118
|
-
{{#if (eq integrations.payloadStorage 'gcs')}}
|
|
119
|
-
gcsStorage({
|
|
120
|
-
collections: {
|
|
121
|
-
media: true,
|
|
122
|
-
},
|
|
123
|
-
bucket: process.env.GCS_BUCKET!,
|
|
124
|
-
options: {
|
|
125
|
-
projectId: process.env.GCS_PROJECT_ID,
|
|
126
|
-
credentials: JSON.parse(process.env.GCS_CREDENTIALS || '{}'),
|
|
127
|
-
},
|
|
128
|
-
}),
|
|
129
|
-
{{/if}}
|
|
130
|
-
seoPlugin({
|
|
131
|
-
collections: ['pages', 'posts'],
|
|
132
|
-
uploadsCollection: 'media',
|
|
133
|
-
generateTitle: ({ doc }) => `${doc?.title ?? ''} | {{projectName}}`,
|
|
134
|
-
generateDescription: ({ doc }) => doc?.excerpt ?? '',
|
|
135
|
-
}),
|
|
136
|
-
],
|
|
137
|
-
cors: [getServerSideURL()].filter(Boolean),
|
|
138
|
-
secret: process.env.PAYLOAD_SECRET!,
|
|
139
|
-
sharp,
|
|
140
|
-
typescript: {
|
|
141
|
-
outputFile: path.resolve(__dirname, 'payload-types.ts'),
|
|
142
|
-
},
|
|
143
|
-
{{#if (eq integrations.payloadStorage 'local')}}
|
|
144
|
-
upload: {
|
|
145
|
-
limits: {
|
|
146
|
-
fileSize: 5000000, // 5MB
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
{{/if}}
|
|
25
|
+
admin: {
|
|
26
|
+
components: {
|
|
27
|
+
// The `BeforeLogin` component renders a message that you see while logging into your admin panel.
|
|
28
|
+
// Feel free to delete this at any time. Simply remove the line below.
|
|
29
|
+
beforeLogin: ["@/components/BeforeLogin"],
|
|
30
|
+
// The `BeforeDashboard` component renders the 'welcome' block that you see after logging into your admin panel.
|
|
31
|
+
// Feel free to delete this at any time. Simply remove the line below.
|
|
32
|
+
beforeDashboard: ["@/components/BeforeDashboard"],
|
|
33
|
+
},
|
|
34
|
+
importMap: {
|
|
35
|
+
baseDir: path.resolve(dirname),
|
|
36
|
+
},
|
|
37
|
+
user: Users.slug,
|
|
38
|
+
livePreview: {
|
|
39
|
+
breakpoints: [
|
|
40
|
+
{
|
|
41
|
+
label: "Mobile",
|
|
42
|
+
name: "mobile",
|
|
43
|
+
width: 375,
|
|
44
|
+
height: 667,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: "Tablet",
|
|
48
|
+
name: "tablet",
|
|
49
|
+
width: 768,
|
|
50
|
+
height: 1024,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
label: "Desktop",
|
|
54
|
+
name: "desktop",
|
|
55
|
+
width: 1440,
|
|
56
|
+
height: 900,
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
// This config helps us configure global or default features that the other editors can inherit
|
|
62
|
+
editor: defaultLexical,
|
|
63
|
+
db: postgresAdapter({
|
|
64
|
+
pool: {
|
|
65
|
+
connectionString: process.env.DATABASE_URL || "",
|
|
66
|
+
},
|
|
67
|
+
// Disable auto-push in dev mode to prevent constraint name truncation issues
|
|
68
|
+
// Use migrations instead: pnpm payload migrate
|
|
69
|
+
push: false,
|
|
70
|
+
}),
|
|
71
|
+
collections: [Pages, Posts, Media, Categories, FAQs, Users],
|
|
72
|
+
cors: [getServerSideURL()].filter(Boolean),
|
|
73
|
+
globals: [Header, Footer],
|
|
74
|
+
plugins,
|
|
75
|
+
secret: process.env.PAYLOAD_SECRET,
|
|
76
|
+
sharp: sharp as unknown as SharpDependency,
|
|
77
|
+
email: resendAdapter({
|
|
78
|
+
apiKey: process.env.RESEND_API_KEY || "",
|
|
79
|
+
defaultFromAddress: process.env.RESEND_FROM_EMAIL || "noreply@example.com",
|
|
80
|
+
defaultFromName: "{{projectName}}",
|
|
81
|
+
}),
|
|
82
|
+
typescript: {
|
|
83
|
+
outputFile: path.resolve(dirname, "payload-types.ts"),
|
|
84
|
+
},
|
|
85
|
+
jobs: {
|
|
86
|
+
access: {
|
|
87
|
+
run: ({ req }: { req: PayloadRequest }): boolean => {
|
|
88
|
+
// Allow logged in users to execute this endpoint (default)
|
|
89
|
+
if (req.user) return true
|
|
90
|
+
|
|
91
|
+
// If there is no logged in user, then check
|
|
92
|
+
// for the Vercel Cron secret to be present as an
|
|
93
|
+
// Authorization header:
|
|
94
|
+
const authHeader = req.headers.get("authorization")
|
|
95
|
+
return authHeader === `Bearer ${process.env.CRON_SECRET}`
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
tasks: [],
|
|
99
|
+
},
|
|
150
100
|
})
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { revalidateRedirects } from "@/hooks/revalidateRedirects"
|
|
2
|
+
import { beforeSyncWithSearch } from "@/search/beforeSync"
|
|
3
|
+
import { searchFields } from "@/search/fieldOverrides"
|
|
4
|
+
import { formBuilderPlugin } from "@payloadcms/plugin-form-builder"
|
|
5
|
+
import { nestedDocsPlugin } from "@payloadcms/plugin-nested-docs"
|
|
6
|
+
import { redirectsPlugin } from "@payloadcms/plugin-redirects"
|
|
7
|
+
import { searchPlugin } from "@payloadcms/plugin-search"
|
|
8
|
+
import { seoPlugin } from "@payloadcms/plugin-seo"
|
|
9
|
+
import type { GenerateTitle, GenerateURL } from "@payloadcms/plugin-seo/types"
|
|
10
|
+
import { FixedToolbarFeature, HeadingFeature, lexicalEditor } from "@payloadcms/richtext-lexical"
|
|
11
|
+
import { vercelBlobStorage } from "@payloadcms/storage-vercel-blob"
|
|
12
|
+
import type { Plugin } from "payload"
|
|
13
|
+
|
|
14
|
+
import type { Page, Post } from "@/payload-types"
|
|
15
|
+
import { getServerSideURL } from "@/utilities/getURL"
|
|
16
|
+
|
|
17
|
+
const generateTitle: GenerateTitle<Post | Page> = ({ doc }) => {
|
|
18
|
+
return doc?.title ? `${doc.title} | Payload Website Template` : "Payload Website Template"
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const generateURL: GenerateURL<Post | Page> = ({ doc }) => {
|
|
22
|
+
const url = getServerSideURL()
|
|
23
|
+
|
|
24
|
+
return doc?.slug ? `${url}/${doc.slug}` : url
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const plugins: Plugin[] = [
|
|
28
|
+
// Vercel Blob Storage for media uploads in production
|
|
29
|
+
...(process.env.BLOB_READ_WRITE_TOKEN
|
|
30
|
+
? [
|
|
31
|
+
vercelBlobStorage({
|
|
32
|
+
collections: {
|
|
33
|
+
media: true,
|
|
34
|
+
},
|
|
35
|
+
token: process.env.BLOB_READ_WRITE_TOKEN,
|
|
36
|
+
// Enable client-side uploads to bypass Vercel serverless function body size limits
|
|
37
|
+
// This allows uploads up to 500MB directly to Vercel Blob Storage
|
|
38
|
+
clientUploads: true,
|
|
39
|
+
}),
|
|
40
|
+
]
|
|
41
|
+
: []),
|
|
42
|
+
redirectsPlugin({
|
|
43
|
+
collections: ["pages", "posts"],
|
|
44
|
+
overrides: {
|
|
45
|
+
// @ts-expect-error - This is a valid override, mapped fields don't resolve to the same type
|
|
46
|
+
fields: ({ defaultFields }) => {
|
|
47
|
+
return defaultFields.map((field) => {
|
|
48
|
+
if ("name" in field && field.name === "from") {
|
|
49
|
+
return {
|
|
50
|
+
...field,
|
|
51
|
+
admin: {
|
|
52
|
+
description: "You will need to rebuild the website when changing this field.",
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return field
|
|
57
|
+
})
|
|
58
|
+
},
|
|
59
|
+
hooks: {
|
|
60
|
+
afterChange: [revalidateRedirects],
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
}),
|
|
64
|
+
nestedDocsPlugin({
|
|
65
|
+
collections: ["categories"],
|
|
66
|
+
generateURL: (docs) => docs.reduce((url, doc) => `${url}/${doc.slug}`, ""),
|
|
67
|
+
}),
|
|
68
|
+
seoPlugin({
|
|
69
|
+
generateTitle,
|
|
70
|
+
generateURL,
|
|
71
|
+
}),
|
|
72
|
+
formBuilderPlugin({
|
|
73
|
+
fields: {
|
|
74
|
+
payment: false,
|
|
75
|
+
},
|
|
76
|
+
formOverrides: {
|
|
77
|
+
fields: ({ defaultFields }) => {
|
|
78
|
+
return defaultFields.map((field) => {
|
|
79
|
+
if ("name" in field && field.name === "confirmationMessage") {
|
|
80
|
+
return {
|
|
81
|
+
...field,
|
|
82
|
+
editor: lexicalEditor({
|
|
83
|
+
features: ({ rootFeatures }) => {
|
|
84
|
+
return [
|
|
85
|
+
...rootFeatures,
|
|
86
|
+
FixedToolbarFeature(),
|
|
87
|
+
HeadingFeature({ enabledHeadingSizes: ["h1", "h2", "h3", "h4"] }),
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
}),
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return field
|
|
94
|
+
})
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
}),
|
|
98
|
+
searchPlugin({
|
|
99
|
+
collections: ["posts"],
|
|
100
|
+
beforeSync: beforeSyncWithSearch,
|
|
101
|
+
searchOverrides: {
|
|
102
|
+
fields: ({ defaultFields }) => {
|
|
103
|
+
return [...defaultFields, ...searchFields]
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
}),
|
|
107
|
+
]
|