kofi-stack-template-generator 2.1.37 → 2.1.39
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 +124 -0
- package/templates/marketing/payload/src/blocks/FeatureGrid/config.ts +120 -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,70 @@
|
|
|
1
|
+
import type { Block } from "payload"
|
|
2
|
+
|
|
3
|
+
export const TrustColumns: Block = {
|
|
4
|
+
slug: "trustColumns",
|
|
5
|
+
interfaceName: "TrustColumnsBlock",
|
|
6
|
+
fields: [
|
|
7
|
+
{
|
|
8
|
+
name: "columns",
|
|
9
|
+
type: "array",
|
|
10
|
+
label: "Trust Columns",
|
|
11
|
+
minRows: 1,
|
|
12
|
+
maxRows: 2,
|
|
13
|
+
fields: [
|
|
14
|
+
{
|
|
15
|
+
name: "label",
|
|
16
|
+
type: "text",
|
|
17
|
+
label: "Label",
|
|
18
|
+
admin: {
|
|
19
|
+
description: 'Small label above heading (e.g., "Integrations")',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "heading",
|
|
24
|
+
type: "text",
|
|
25
|
+
label: "Heading",
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "description",
|
|
30
|
+
type: "textarea",
|
|
31
|
+
label: "Description",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "items",
|
|
35
|
+
type: "array",
|
|
36
|
+
label: "Feature Items",
|
|
37
|
+
maxRows: 6,
|
|
38
|
+
fields: [
|
|
39
|
+
{
|
|
40
|
+
name: "icon",
|
|
41
|
+
type: "select",
|
|
42
|
+
options: [
|
|
43
|
+
{ label: "Check", value: "check" },
|
|
44
|
+
{ label: "Shield", value: "shield" },
|
|
45
|
+
{ label: "Lock", value: "lock" },
|
|
46
|
+
{ label: "Globe", value: "globe" },
|
|
47
|
+
{ label: "Zap", value: "zap" },
|
|
48
|
+
{ label: "Server", value: "server" },
|
|
49
|
+
{ label: "Cloud", value: "cloud" },
|
|
50
|
+
{ label: "Database", value: "database" },
|
|
51
|
+
{ label: "Plug", value: "plug" },
|
|
52
|
+
{ label: "Award", value: "award" },
|
|
53
|
+
],
|
|
54
|
+
defaultValue: "check",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "text",
|
|
58
|
+
type: "text",
|
|
59
|
+
required: true,
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
labels: {
|
|
67
|
+
plural: "Trust Columns",
|
|
68
|
+
singular: "Trust Columns",
|
|
69
|
+
},
|
|
70
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { CollectionConfig } from "payload"
|
|
2
|
+
|
|
3
|
+
import { slugField } from "payload"
|
|
4
|
+
import { anyone } from "../access/anyone"
|
|
5
|
+
import { authenticated } from "../access/authenticated"
|
|
6
|
+
|
|
7
|
+
export const Categories: CollectionConfig = {
|
|
8
|
+
slug: "categories",
|
|
9
|
+
access: {
|
|
10
|
+
create: authenticated,
|
|
11
|
+
delete: authenticated,
|
|
12
|
+
read: anyone,
|
|
13
|
+
update: authenticated,
|
|
14
|
+
},
|
|
15
|
+
admin: {
|
|
16
|
+
useAsTitle: "title",
|
|
17
|
+
},
|
|
18
|
+
fields: [
|
|
19
|
+
{
|
|
20
|
+
name: "title",
|
|
21
|
+
type: "text",
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
slugField({
|
|
25
|
+
position: undefined,
|
|
26
|
+
}),
|
|
27
|
+
],
|
|
28
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { CollectionConfig } from "payload"
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
AlignFeature,
|
|
5
|
+
BlockquoteFeature,
|
|
6
|
+
ChecklistFeature,
|
|
7
|
+
EXPERIMENTAL_TableFeature,
|
|
8
|
+
FixedToolbarFeature,
|
|
9
|
+
IndentFeature,
|
|
10
|
+
InlineCodeFeature,
|
|
11
|
+
InlineToolbarFeature,
|
|
12
|
+
OrderedListFeature,
|
|
13
|
+
RelationshipFeature,
|
|
14
|
+
StrikethroughFeature,
|
|
15
|
+
SubscriptFeature,
|
|
16
|
+
SuperscriptFeature,
|
|
17
|
+
UnorderedListFeature,
|
|
18
|
+
UploadFeature,
|
|
19
|
+
lexicalEditor,
|
|
20
|
+
} from "@payloadcms/richtext-lexical"
|
|
21
|
+
import { anyone } from "../../access/anyone"
|
|
22
|
+
import { authenticated } from "../../access/authenticated"
|
|
23
|
+
|
|
24
|
+
export const FAQs: CollectionConfig = {
|
|
25
|
+
slug: "faqs",
|
|
26
|
+
access: {
|
|
27
|
+
create: authenticated,
|
|
28
|
+
delete: authenticated,
|
|
29
|
+
read: anyone,
|
|
30
|
+
update: authenticated,
|
|
31
|
+
},
|
|
32
|
+
admin: {
|
|
33
|
+
useAsTitle: "question",
|
|
34
|
+
defaultColumns: ["question", "category", "order", "updatedAt"],
|
|
35
|
+
group: "Content",
|
|
36
|
+
},
|
|
37
|
+
fields: [
|
|
38
|
+
{
|
|
39
|
+
name: "question",
|
|
40
|
+
type: "text",
|
|
41
|
+
required: true,
|
|
42
|
+
label: "Question",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "answer",
|
|
46
|
+
type: "richText",
|
|
47
|
+
required: true,
|
|
48
|
+
label: "Answer",
|
|
49
|
+
editor: lexicalEditor({
|
|
50
|
+
features: ({ rootFeatures }) => {
|
|
51
|
+
return [
|
|
52
|
+
...rootFeatures,
|
|
53
|
+
FixedToolbarFeature(),
|
|
54
|
+
InlineToolbarFeature(),
|
|
55
|
+
StrikethroughFeature(),
|
|
56
|
+
SubscriptFeature(),
|
|
57
|
+
SuperscriptFeature(),
|
|
58
|
+
InlineCodeFeature(),
|
|
59
|
+
BlockquoteFeature(),
|
|
60
|
+
UnorderedListFeature(),
|
|
61
|
+
OrderedListFeature(),
|
|
62
|
+
ChecklistFeature(),
|
|
63
|
+
AlignFeature(),
|
|
64
|
+
IndentFeature(),
|
|
65
|
+
RelationshipFeature(),
|
|
66
|
+
UploadFeature(),
|
|
67
|
+
EXPERIMENTAL_TableFeature(),
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
}),
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "category",
|
|
74
|
+
type: "select",
|
|
75
|
+
required: true,
|
|
76
|
+
defaultValue: "general",
|
|
77
|
+
options: [
|
|
78
|
+
{ label: "General", value: "general" },
|
|
79
|
+
{ label: "Pricing", value: "pricing" },
|
|
80
|
+
{ label: "Features", value: "features" },
|
|
81
|
+
{ label: "Getting Started", value: "getting-started" },
|
|
82
|
+
{ label: "Technical", value: "technical" },
|
|
83
|
+
{ label: "Support", value: "support" },
|
|
84
|
+
],
|
|
85
|
+
admin: {
|
|
86
|
+
position: "sidebar",
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: "order",
|
|
91
|
+
type: "number",
|
|
92
|
+
defaultValue: 0,
|
|
93
|
+
admin: {
|
|
94
|
+
position: "sidebar",
|
|
95
|
+
description: "Lower numbers appear first",
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
defaultSort: "order",
|
|
100
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import type { CollectionConfig } from "payload"
|
|
2
|
+
|
|
3
|
+
import path from "node:path"
|
|
4
|
+
import { fileURLToPath } from "node:url"
|
|
5
|
+
import {
|
|
6
|
+
AlignFeature,
|
|
7
|
+
BlockquoteFeature,
|
|
8
|
+
ChecklistFeature,
|
|
9
|
+
EXPERIMENTAL_TableFeature,
|
|
10
|
+
FixedToolbarFeature,
|
|
11
|
+
IndentFeature,
|
|
12
|
+
InlineCodeFeature,
|
|
13
|
+
InlineToolbarFeature,
|
|
14
|
+
OrderedListFeature,
|
|
15
|
+
RelationshipFeature,
|
|
16
|
+
StrikethroughFeature,
|
|
17
|
+
SubscriptFeature,
|
|
18
|
+
SuperscriptFeature,
|
|
19
|
+
UnorderedListFeature,
|
|
20
|
+
UploadFeature,
|
|
21
|
+
lexicalEditor,
|
|
22
|
+
} from "@payloadcms/richtext-lexical"
|
|
23
|
+
|
|
24
|
+
import { anyone } from "../access/anyone"
|
|
25
|
+
import { authenticated } from "../access/authenticated"
|
|
26
|
+
|
|
27
|
+
const filename = fileURLToPath(import.meta.url)
|
|
28
|
+
const dirname = path.dirname(filename)
|
|
29
|
+
|
|
30
|
+
// Only use local staticDir when BLOB_READ_WRITE_TOKEN is not set (local development)
|
|
31
|
+
// In production, Vercel Blob Storage handles file storage
|
|
32
|
+
const useLocalStorage = !process.env.BLOB_READ_WRITE_TOKEN
|
|
33
|
+
|
|
34
|
+
export const Media: CollectionConfig = {
|
|
35
|
+
slug: "media",
|
|
36
|
+
folders: true,
|
|
37
|
+
access: {
|
|
38
|
+
create: authenticated,
|
|
39
|
+
delete: authenticated,
|
|
40
|
+
read: anyone,
|
|
41
|
+
update: authenticated,
|
|
42
|
+
},
|
|
43
|
+
fields: [
|
|
44
|
+
{
|
|
45
|
+
name: "alt",
|
|
46
|
+
type: "text",
|
|
47
|
+
//required: true,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "caption",
|
|
51
|
+
type: "richText",
|
|
52
|
+
editor: lexicalEditor({
|
|
53
|
+
features: ({ rootFeatures }) => {
|
|
54
|
+
return [
|
|
55
|
+
...rootFeatures,
|
|
56
|
+
FixedToolbarFeature(),
|
|
57
|
+
InlineToolbarFeature(),
|
|
58
|
+
StrikethroughFeature(),
|
|
59
|
+
SubscriptFeature(),
|
|
60
|
+
SuperscriptFeature(),
|
|
61
|
+
InlineCodeFeature(),
|
|
62
|
+
BlockquoteFeature(),
|
|
63
|
+
UnorderedListFeature(),
|
|
64
|
+
OrderedListFeature(),
|
|
65
|
+
ChecklistFeature(),
|
|
66
|
+
AlignFeature(),
|
|
67
|
+
IndentFeature(),
|
|
68
|
+
RelationshipFeature(),
|
|
69
|
+
UploadFeature(),
|
|
70
|
+
EXPERIMENTAL_TableFeature(),
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
}),
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
upload: {
|
|
77
|
+
// Only use local staticDir for development; production uses Vercel Blob Storage
|
|
78
|
+
...(useLocalStorage && {
|
|
79
|
+
staticDir: path.resolve(dirname, "../../public/media"),
|
|
80
|
+
}),
|
|
81
|
+
adminThumbnail: "thumbnail",
|
|
82
|
+
focalPoint: true,
|
|
83
|
+
// Allow common image and video file types
|
|
84
|
+
mimeTypes: [
|
|
85
|
+
"image/*",
|
|
86
|
+
"video/mp4",
|
|
87
|
+
"video/webm",
|
|
88
|
+
"video/quicktime", // .mov files
|
|
89
|
+
],
|
|
90
|
+
// Convert original uploaded image to WebP format for better compression
|
|
91
|
+
// Note: formatOptions only applies to images, videos are uploaded as-is
|
|
92
|
+
formatOptions: {
|
|
93
|
+
format: "webp",
|
|
94
|
+
options: {
|
|
95
|
+
quality: 85,
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
imageSizes: [
|
|
99
|
+
{
|
|
100
|
+
name: "thumbnail",
|
|
101
|
+
width: 300,
|
|
102
|
+
formatOptions: {
|
|
103
|
+
format: "webp",
|
|
104
|
+
options: { quality: 80 },
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: "square",
|
|
109
|
+
width: 500,
|
|
110
|
+
height: 500,
|
|
111
|
+
formatOptions: {
|
|
112
|
+
format: "webp",
|
|
113
|
+
options: { quality: 80 },
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: "small",
|
|
118
|
+
width: 600,
|
|
119
|
+
formatOptions: {
|
|
120
|
+
format: "webp",
|
|
121
|
+
options: { quality: 80 },
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: "medium",
|
|
126
|
+
width: 900,
|
|
127
|
+
formatOptions: {
|
|
128
|
+
format: "webp",
|
|
129
|
+
options: { quality: 80 },
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: "large",
|
|
134
|
+
width: 1400,
|
|
135
|
+
formatOptions: {
|
|
136
|
+
format: "webp",
|
|
137
|
+
options: { quality: 80 },
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: "xlarge",
|
|
142
|
+
width: 1920,
|
|
143
|
+
formatOptions: {
|
|
144
|
+
format: "webp",
|
|
145
|
+
options: { quality: 80 },
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "og",
|
|
150
|
+
width: 1200,
|
|
151
|
+
height: 630,
|
|
152
|
+
crop: "center",
|
|
153
|
+
formatOptions: {
|
|
154
|
+
format: "webp",
|
|
155
|
+
options: { quality: 85 },
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { CollectionAfterChangeHook, CollectionAfterDeleteHook } from "payload"
|
|
2
|
+
|
|
3
|
+
import { revalidatePath, revalidateTag } from "next/cache"
|
|
4
|
+
|
|
5
|
+
import type { Page } from "../../../payload-types"
|
|
6
|
+
|
|
7
|
+
export const revalidatePage: CollectionAfterChangeHook<Page> = ({
|
|
8
|
+
doc,
|
|
9
|
+
previousDoc,
|
|
10
|
+
req: { payload, context },
|
|
11
|
+
}) => {
|
|
12
|
+
if (!context.disableRevalidate) {
|
|
13
|
+
if (doc._status === "published") {
|
|
14
|
+
const path = doc.slug === "home" ? "/" : `/${doc.slug}`
|
|
15
|
+
|
|
16
|
+
payload.logger.info(`Revalidating page at path: ${path}`)
|
|
17
|
+
|
|
18
|
+
revalidatePath(path)
|
|
19
|
+
revalidateTag("pages-sitemap")
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// If the page was previously published, we need to revalidate the old path
|
|
23
|
+
if (previousDoc?._status === "published" && doc._status !== "published") {
|
|
24
|
+
const oldPath = previousDoc.slug === "home" ? "/" : `/${previousDoc.slug}`
|
|
25
|
+
|
|
26
|
+
payload.logger.info(`Revalidating old page at path: ${oldPath}`)
|
|
27
|
+
|
|
28
|
+
revalidatePath(oldPath)
|
|
29
|
+
revalidateTag("pages-sitemap")
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return doc
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const revalidateDelete: CollectionAfterDeleteHook<Page> = ({ doc, req: { context } }) => {
|
|
36
|
+
if (!context.disableRevalidate) {
|
|
37
|
+
const path = doc?.slug === "home" ? "/" : `/${doc?.slug}`
|
|
38
|
+
revalidatePath(path)
|
|
39
|
+
revalidateTag("pages-sitemap")
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return doc
|
|
43
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import type { CollectionConfig } from "payload"
|
|
2
|
+
|
|
3
|
+
import { hero } from "@/heros/config"
|
|
4
|
+
import { slugField } from "payload"
|
|
5
|
+
import { authenticated } from "../../access/authenticated"
|
|
6
|
+
import { authenticatedOrPublished } from "../../access/authenticatedOrPublished"
|
|
7
|
+
import { Archive } from "../../blocks/ArchiveBlock/config"
|
|
8
|
+
import { BentoFeatures } from "../../blocks/BentoFeatures/config"
|
|
9
|
+
import { CallToAction } from "../../blocks/CallToAction/config"
|
|
10
|
+
import { Content } from "../../blocks/Content/config"
|
|
11
|
+
import { FAQAccordion } from "../../blocks/FAQAccordion/config"
|
|
12
|
+
import { FeatureGrid } from "../../blocks/FeatureGrid/config"
|
|
13
|
+
import { FeatureShowcase } from "../../blocks/FeatureShowcase/config"
|
|
14
|
+
import { FinalCTA } from "../../blocks/FinalCTA/config"
|
|
15
|
+
import { FormBlock } from "../../blocks/Form/config"
|
|
16
|
+
import { HowItWorks } from "../../blocks/HowItWorks/config"
|
|
17
|
+
import { IndustryTabs } from "../../blocks/IndustryTabs/config"
|
|
18
|
+
import { LogoBanner } from "../../blocks/LogoBanner/config"
|
|
19
|
+
import { MediaBlock } from "../../blocks/MediaBlock/config"
|
|
20
|
+
import { Personas } from "../../blocks/Personas/config"
|
|
21
|
+
import { PricingTable } from "../../blocks/PricingTable/config"
|
|
22
|
+
import { ProofBanner } from "../../blocks/ProofBanner/config"
|
|
23
|
+
import { TestimonialsGrid } from "../../blocks/TestimonialsGrid/config"
|
|
24
|
+
import { TrustColumns } from "../../blocks/TrustColumns/config"
|
|
25
|
+
import { populatePublishedAt } from "../../hooks/populatePublishedAt"
|
|
26
|
+
import { generatePreviewPath } from "../../utilities/generatePreviewPath"
|
|
27
|
+
import { revalidateDelete, revalidatePage } from "./hooks/revalidatePage"
|
|
28
|
+
|
|
29
|
+
import {
|
|
30
|
+
MetaDescriptionField,
|
|
31
|
+
MetaImageField,
|
|
32
|
+
MetaTitleField,
|
|
33
|
+
OverviewField,
|
|
34
|
+
PreviewField,
|
|
35
|
+
} from "@payloadcms/plugin-seo/fields"
|
|
36
|
+
|
|
37
|
+
export const Pages: CollectionConfig<"pages"> = {
|
|
38
|
+
slug: "pages",
|
|
39
|
+
access: {
|
|
40
|
+
create: authenticated,
|
|
41
|
+
delete: authenticated,
|
|
42
|
+
read: authenticatedOrPublished,
|
|
43
|
+
update: authenticated,
|
|
44
|
+
},
|
|
45
|
+
// This config controls what's populated by default when a page is referenced
|
|
46
|
+
// https://payloadcms.com/docs/queries/select#defaultpopulate-collection-config-property
|
|
47
|
+
// Type safe if the collection slug generic is passed to `CollectionConfig` - `CollectionConfig<'pages'>
|
|
48
|
+
defaultPopulate: {
|
|
49
|
+
title: true,
|
|
50
|
+
slug: true,
|
|
51
|
+
},
|
|
52
|
+
admin: {
|
|
53
|
+
defaultColumns: ["title", "slug", "updatedAt"],
|
|
54
|
+
livePreview: {
|
|
55
|
+
url: ({ data, req }) =>
|
|
56
|
+
generatePreviewPath({
|
|
57
|
+
slug: data?.slug,
|
|
58
|
+
collection: "pages",
|
|
59
|
+
req,
|
|
60
|
+
}),
|
|
61
|
+
},
|
|
62
|
+
preview: (data, { req }) =>
|
|
63
|
+
generatePreviewPath({
|
|
64
|
+
slug: data?.slug as string,
|
|
65
|
+
collection: "pages",
|
|
66
|
+
req,
|
|
67
|
+
}),
|
|
68
|
+
useAsTitle: "title",
|
|
69
|
+
},
|
|
70
|
+
fields: [
|
|
71
|
+
{
|
|
72
|
+
name: "title",
|
|
73
|
+
type: "text",
|
|
74
|
+
required: true,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
type: "tabs",
|
|
78
|
+
tabs: [
|
|
79
|
+
{
|
|
80
|
+
fields: [hero],
|
|
81
|
+
label: "Hero",
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
fields: [
|
|
85
|
+
{
|
|
86
|
+
name: "layout",
|
|
87
|
+
type: "blocks",
|
|
88
|
+
blocks: [
|
|
89
|
+
Archive,
|
|
90
|
+
BentoFeatures,
|
|
91
|
+
CallToAction,
|
|
92
|
+
Content,
|
|
93
|
+
FAQAccordion,
|
|
94
|
+
FeatureGrid,
|
|
95
|
+
FeatureShowcase,
|
|
96
|
+
FinalCTA,
|
|
97
|
+
FormBlock,
|
|
98
|
+
HowItWorks,
|
|
99
|
+
IndustryTabs,
|
|
100
|
+
LogoBanner,
|
|
101
|
+
MediaBlock,
|
|
102
|
+
Personas,
|
|
103
|
+
PricingTable,
|
|
104
|
+
ProofBanner,
|
|
105
|
+
TestimonialsGrid,
|
|
106
|
+
TrustColumns,
|
|
107
|
+
],
|
|
108
|
+
required: true,
|
|
109
|
+
admin: {
|
|
110
|
+
initCollapsed: true,
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
label: "Content",
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: "meta",
|
|
118
|
+
label: "SEO",
|
|
119
|
+
fields: [
|
|
120
|
+
OverviewField({
|
|
121
|
+
titlePath: "meta.title",
|
|
122
|
+
descriptionPath: "meta.description",
|
|
123
|
+
imagePath: "meta.image",
|
|
124
|
+
}),
|
|
125
|
+
MetaTitleField({
|
|
126
|
+
hasGenerateFn: true,
|
|
127
|
+
}),
|
|
128
|
+
MetaImageField({
|
|
129
|
+
relationTo: "media",
|
|
130
|
+
}),
|
|
131
|
+
|
|
132
|
+
MetaDescriptionField({}),
|
|
133
|
+
PreviewField({
|
|
134
|
+
// if the `generateUrl` function is configured
|
|
135
|
+
hasGenerateFn: true,
|
|
136
|
+
|
|
137
|
+
// field paths to match the target field for data
|
|
138
|
+
titlePath: "meta.title",
|
|
139
|
+
descriptionPath: "meta.description",
|
|
140
|
+
}),
|
|
141
|
+
],
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: "publishedAt",
|
|
147
|
+
type: "date",
|
|
148
|
+
admin: {
|
|
149
|
+
position: "sidebar",
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
slugField(),
|
|
153
|
+
],
|
|
154
|
+
hooks: {
|
|
155
|
+
afterChange: [revalidatePage],
|
|
156
|
+
beforeChange: [populatePublishedAt],
|
|
157
|
+
afterDelete: [revalidateDelete],
|
|
158
|
+
},
|
|
159
|
+
versions: {
|
|
160
|
+
drafts: {
|
|
161
|
+
autosave: {
|
|
162
|
+
interval: 100, // We set this interval for optimal live preview
|
|
163
|
+
},
|
|
164
|
+
schedulePublish: true,
|
|
165
|
+
},
|
|
166
|
+
maxPerDoc: 50,
|
|
167
|
+
},
|
|
168
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { CollectionAfterReadHook } from "payload"
|
|
2
|
+
import type { User } from "src/payload-types"
|
|
3
|
+
|
|
4
|
+
// The `user` collection has access control locked so that users are not publicly accessible
|
|
5
|
+
// This means that we need to populate the authors manually here to protect user privacy
|
|
6
|
+
// GraphQL will not return mutated user data that differs from the underlying schema
|
|
7
|
+
// So we use an alternative `populatedAuthors` field to populate the user data, hidden from the admin UI
|
|
8
|
+
export const populateAuthors: CollectionAfterReadHook = async ({
|
|
9
|
+
doc,
|
|
10
|
+
req: _req,
|
|
11
|
+
req: { payload },
|
|
12
|
+
}) => {
|
|
13
|
+
if (doc?.authors && doc?.authors?.length > 0) {
|
|
14
|
+
const authorDocs: User[] = []
|
|
15
|
+
|
|
16
|
+
for (const author of doc.authors) {
|
|
17
|
+
try {
|
|
18
|
+
const authorDoc = await payload.findByID({
|
|
19
|
+
id: typeof author === "object" ? author?.id : author,
|
|
20
|
+
collection: "users",
|
|
21
|
+
depth: 0,
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
if (authorDoc) {
|
|
25
|
+
authorDocs.push(authorDoc)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (authorDocs.length > 0) {
|
|
29
|
+
doc.populatedAuthors = authorDocs.map((authorDoc) => ({
|
|
30
|
+
id: authorDoc.id,
|
|
31
|
+
name: authorDoc.name,
|
|
32
|
+
}))
|
|
33
|
+
}
|
|
34
|
+
} catch {
|
|
35
|
+
// swallow error
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return doc
|
|
41
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { CollectionAfterChangeHook, CollectionAfterDeleteHook } from "payload"
|
|
2
|
+
|
|
3
|
+
import { revalidatePath, revalidateTag } from "next/cache"
|
|
4
|
+
|
|
5
|
+
import type { Post } from "../../../payload-types"
|
|
6
|
+
|
|
7
|
+
export const revalidatePost: CollectionAfterChangeHook<Post> = ({
|
|
8
|
+
doc,
|
|
9
|
+
previousDoc,
|
|
10
|
+
req: { payload, context },
|
|
11
|
+
}) => {
|
|
12
|
+
if (!context.disableRevalidate) {
|
|
13
|
+
if (doc._status === "published") {
|
|
14
|
+
const path = `/posts/${doc.slug}`
|
|
15
|
+
|
|
16
|
+
payload.logger.info(`Revalidating post at path: ${path}`)
|
|
17
|
+
|
|
18
|
+
revalidatePath(path)
|
|
19
|
+
revalidateTag("posts-sitemap")
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// If the post was previously published, we need to revalidate the old path
|
|
23
|
+
if (previousDoc._status === "published" && doc._status !== "published") {
|
|
24
|
+
const oldPath = `/posts/${previousDoc.slug}`
|
|
25
|
+
|
|
26
|
+
payload.logger.info(`Revalidating old post at path: ${oldPath}`)
|
|
27
|
+
|
|
28
|
+
revalidatePath(oldPath)
|
|
29
|
+
revalidateTag("posts-sitemap")
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return doc
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const revalidateDelete: CollectionAfterDeleteHook<Post> = ({ doc, req: { context } }) => {
|
|
36
|
+
if (!context.disableRevalidate) {
|
|
37
|
+
const path = `/posts/${doc?.slug}`
|
|
38
|
+
|
|
39
|
+
revalidatePath(path)
|
|
40
|
+
revalidateTag("posts-sitemap")
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return doc
|
|
44
|
+
}
|