Skip to content

Commit 5c39e48

Browse files
committed
Merge branch 'main' of https://github.com/code0-tech/cygnus
2 parents 6323ba9 + 3f21cf1 commit 5c39e48

32 files changed

Lines changed: 682 additions & 856 deletions

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
"@c15t/nextjs": "^2.1.0",
2828
"@c15t/react": "^2.1.0",
2929
"@c15t/scripts": "^2.1.0",
30-
"@code0-tech/pictor": "^0.13.1",
30+
"@code0-tech/pictor": "^0.14.0",
3131
"@icons-pack/react-simple-icons": "^13.13.0",
32-
"@mvriu5/payload-ai": "^1.6.0",
32+
"@mvriu5/payload-ai": "^1.6.1",
3333
"@mvriu5/payload-color-picker": "^1.0.2",
3434
"@mvriu5/payload-icon-picker": "^1.1.1",
3535
"@mvriu5/payload-portable-plugin": "^0.8.2",
Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
1+
import { PageBlocks } from "@/components/PageBlockRenderer"
2+
import { LandingContainer } from "@/components/ui/LandingContainer"
3+
import { getCustomLandingPage } from "@/lib/cms"
4+
import { isSupportedLocale } from "@/lib/i18n"
5+
import { getCustomLandingPageMetadata } from "@/lib/pageMetadata"
6+
import type { Metadata } from "next"
17
import { notFound } from "next/navigation"
28

3-
export default function UnknownLocalizedPage() {
4-
notFound()
9+
type CatchAllPageParams = Promise<{ locale: string; rest: string[] }>
10+
11+
async function getCatchAllParams(params: CatchAllPageParams) {
12+
const { locale, rest } = await params
13+
if (!isSupportedLocale(locale) || rest.length !== 1 || !rest[0]?.trim()) notFound()
14+
15+
return { locale, slug: rest[0] }
16+
}
17+
18+
export default async function CustomLandingPage({ params }: { params: CatchAllPageParams }) {
19+
const { locale, slug } = await getCatchAllParams(params)
20+
const page = await getCustomLandingPage(slug, locale)
21+
if (!page) notFound()
22+
23+
return (
24+
<LandingContainer>
25+
<div className="h-12 lg:h-16" aria-hidden="true" />
26+
<PageBlocks blocks={page.layout} locale={locale} />
27+
</LandingContainer>
28+
)
29+
}
30+
31+
export async function generateMetadata({ params }: { params: CatchAllPageParams }): Promise<Metadata> {
32+
const { locale, slug } = await getCatchAllParams(params)
33+
return getCustomLandingPageMetadata(slug, locale)
534
}

src/app/(landing)/globals.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,25 @@
150150
scroll-behavior: auto !important;
151151
}
152152
}
153+
@media (prefers-reduced-motion: no-preference) {
154+
.section-funnel > .section-stagger-item {
155+
opacity: 0;
156+
transform: translateY(1rem);
157+
transition:
158+
opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
159+
transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
160+
}
161+
162+
[data-in-view="true"] > .section-funnel > .section-stagger-item {
163+
opacity: 1;
164+
transform: translateY(0);
165+
}
166+
167+
[data-in-view="true"] > .section-funnel > .section-stagger-item:nth-child(2) {
168+
transition-delay: 0.1s;
169+
}
170+
171+
[data-in-view="true"] > .section-funnel > .section-stagger-item:nth-child(3) {
172+
transition-delay: 0.2s;
173+
}
174+
}

src/app/(landing)/server-sitemap.xml/route.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getActionSlugs, getBlogSlugs, getJobSlugs } from "@/lib/cms"
1+
import { getActionSlugs, getBlogSlugs, getCustomLandingPageSlugs, getJobSlugs } from "@/lib/cms"
22
import { SUPPORTED_LOCALES } from "@/lib/i18n"
33
import { resolveSiteUrl } from "@/lib/siteConfig"
44

@@ -44,12 +44,20 @@ export async function GET() {
4444

4545
const localizedUrls = await Promise.all(
4646
SUPPORTED_LOCALES.map(async (locale) => {
47-
const [blogSlugs, jobSlugs, actionSlugs] = await Promise.all([
47+
const [blogSlugs, jobSlugs, actionSlugs, customPageSlugs] = await Promise.all([
4848
getBlogSlugs(locale),
4949
getJobSlugs(locale),
50-
getActionSlugs(locale)
50+
getActionSlugs(locale),
51+
getCustomLandingPageSlugs(locale),
5152
])
5253

54+
const customPageUrls = customPageSlugs.map((slug): SitemapUrl => ({
55+
loc: new URL(`/${locale}/${slug}`, siteUrl).toString(),
56+
lastmod,
57+
changefreq: "weekly",
58+
priority: 0.7,
59+
}))
60+
5361
const blogUrls = blogSlugs.map((slug): SitemapUrl => ({
5462
loc: new URL(`/${locale}/blog/${slug}`, siteUrl).toString(),
5563
lastmod,
@@ -71,7 +79,7 @@ export async function GET() {
7179
priority: 0.6
7280
}))
7381

74-
return [...blogUrls, ...jobUrls, ...actionUrls]
82+
return [...customPageUrls, ...blogUrls, ...jobUrls, ...actionUrls]
7583
})
7684
)
7785

src/blocks/ActionEventsBlock.ts

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,11 @@
1+
import { sectionFields } from "@/fields/sectionFields"
12
import type { Block } from "payload"
23

34
export const ActionEventsBlock: Block = {
45
slug: "actionEvents",
56
labels: { singular: "Action Events", plural: "Action Events Blocks" },
67
fields: [
7-
{
8-
type: "collapsible",
9-
label: "Section",
10-
fields: [
11-
{ name: "sectionHeading", label: "Section Heading", type: "text", required: false, localized: true },
12-
{
13-
name: "sectionLayout",
14-
label: "Section Layout",
15-
type: "select",
16-
required: true,
17-
defaultValue: "left",
18-
options: [
19-
{ label: "Center", value: "center" },
20-
{ label: "Left", value: "left" },
21-
],
22-
},
23-
{ name: "sectionDescription", label: "Section Description", type: "textarea", required: false, localized: true },
24-
{
25-
name: "sectionLinkButton",
26-
label: "Section Link Button",
27-
type: "group",
28-
fields: [
29-
{ name: "label", type: "text", required: false, localized: true },
30-
{ name: "url", type: "text", required: false },
31-
],
32-
},
33-
],
34-
},
8+
sectionFields({ layoutDefaultValue: "left" }),
359
{ name: "flowTypeLabel", type: "text", required: true, localized: true, defaultValue: "FlowType" },
3610
{ name: "settingsLabel", type: "text", required: true, localized: true, defaultValue: "Settings" },
3711
],

src/blocks/ActionFunctionsBlock.ts

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,11 @@
1+
import { sectionFields } from "@/fields/sectionFields"
12
import type { Block } from "payload"
23

34
export const ActionFunctionsBlock: Block = {
45
slug: "actionFunctions",
56
labels: { singular: "Action Functions", plural: "Action Functions Blocks" },
67
fields: [
7-
{
8-
type: "collapsible",
9-
label: "Section",
10-
fields: [
11-
{ name: "sectionHeading", label: "Section Heading", type: "text", required: false, localized: true },
12-
{
13-
name: "sectionLayout",
14-
label: "Section Layout",
15-
type: "select",
16-
required: true,
17-
defaultValue: "left",
18-
options: [
19-
{ label: "Center", value: "center" },
20-
{ label: "Left", value: "left" },
21-
],
22-
},
23-
{ name: "sectionDescription", label: "Section Description", type: "textarea", required: false, localized: true },
24-
{
25-
name: "sectionLinkButton",
26-
label: "Section Link Button",
27-
type: "group",
28-
fields: [
29-
{ name: "label", type: "text", required: false, localized: true },
30-
{ name: "url", type: "text", required: false },
31-
],
32-
},
33-
],
34-
},
8+
sectionFields({ layoutDefaultValue: "left" }),
359
{ name: "functionDefinitionLabel", type: "text", required: true, localized: true, defaultValue: "FunctionDefinition" },
3610
{ name: "parametersLabel", type: "text", required: true, localized: true, defaultValue: "Parameters" },
3711
],

src/blocks/ActionListBlock.ts

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,15 @@
1+
import { sectionFields } from "@/fields/sectionFields"
12
import type { Block } from "payload"
23

34
export const ActionListBlock: Block = {
45
slug: "actionList",
56
labels: { singular: "Action List", plural: "Action List Blocks" },
67
fields: [
7-
{
8-
type: "collapsible",
9-
label: "Section",
10-
fields: [
11-
{ name: "sectionHeading", label: "Section Heading", type: "text", required: false, localized: true, defaultValue: "Actions" },
12-
{
13-
name: "sectionLayout",
14-
label: "Section Layout",
15-
type: "select",
16-
required: true,
17-
defaultValue: "left",
18-
options: [
19-
{ label: "Center", value: "center" },
20-
{ label: "Left", value: "left" },
21-
],
22-
},
23-
{ name: "sectionDescription", label: "Section Description", type: "textarea", required: false, localized: true, defaultValue: "Browse available actions and integrations." },
24-
{
25-
name: "sectionLinkButton",
26-
label: "Section Link Button",
27-
type: "group",
28-
fields: [
29-
{ name: "label", type: "text", required: false, localized: true },
30-
{ name: "url", type: "text", required: false },
31-
],
32-
},
33-
],
34-
},
8+
sectionFields({
9+
headingDefaultValue: "Actions",
10+
descriptionDefaultValue: "Browse available actions and integrations.",
11+
layoutDefaultValue: "left",
12+
}),
3513
{ name: "searchPlaceholder", type: "text", required: true, localized: true, defaultValue: "Search actions" },
3614
{ name: "sortNewestLabel", type: "text", required: true, localized: true, defaultValue: "Newest" },
3715
{ name: "sortOldestLabel", type: "text", required: true, localized: true, defaultValue: "Oldest" },
Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,10 @@
1+
import { sectionFields } from "@/fields/sectionFields"
12
import type { Block } from "payload"
23

34
export const ActionReferencesBlock: Block = {
45
slug: "actionReferences",
56
labels: { singular: "Action References", plural: "Action Reference Blocks" },
67
fields: [
7-
{
8-
type: "collapsible",
9-
label: "Section",
10-
fields: [
11-
{ name: "sectionHeading", label: "Section Heading", type: "text", required: false, localized: true, defaultValue: "References" },
12-
{
13-
name: "sectionLayout",
14-
label: "Section Layout",
15-
type: "select",
16-
required: true,
17-
defaultValue: "left",
18-
options: [
19-
{ label: "Center", value: "center" },
20-
{ label: "Left", value: "left" },
21-
],
22-
},
23-
{ name: "sectionDescription", label: "Section Description", type: "textarea", required: false, localized: true },
24-
{
25-
name: "sectionLinkButton",
26-
label: "Section Link Button",
27-
type: "group",
28-
fields: [
29-
{ name: "label", type: "text", required: false, localized: true },
30-
{ name: "url", type: "text", required: false },
31-
],
32-
},
33-
],
34-
},
8+
sectionFields({ headingDefaultValue: "References", layoutDefaultValue: "left" }),
359
],
3610
}

src/blocks/BentoBlock.ts

Lines changed: 2 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { sectionFields } from "@/fields/sectionFields"
12
import type { Block } from "payload"
23

34
export const BentoBlock: Block = {
@@ -7,61 +8,7 @@ export const BentoBlock: Block = {
78
plural: "Bento Blocks",
89
},
910
fields: [
10-
{
11-
type: "collapsible",
12-
label: "Section",
13-
fields: [
14-
{
15-
name: "sectionHeading",
16-
label: "Section Heading",
17-
type: "text",
18-
required: false,
19-
localized: true,
20-
},
21-
{
22-
name: "sectionLayout",
23-
label: "Section Layout",
24-
type: "select",
25-
required: true,
26-
defaultValue: "center",
27-
options: [
28-
{
29-
label: "Center",
30-
value: "center",
31-
},
32-
{
33-
label: "Left",
34-
value: "left",
35-
},
36-
],
37-
},
38-
{
39-
name: "sectionDescription",
40-
label: "Section Description",
41-
type: "textarea",
42-
required: false,
43-
localized: true,
44-
},
45-
{
46-
name: "sectionLinkButton",
47-
label: "Section Link Button",
48-
type: "group",
49-
fields: [
50-
{
51-
name: "label",
52-
type: "text",
53-
required: false,
54-
localized: true,
55-
},
56-
{
57-
name: "url",
58-
type: "text",
59-
required: false,
60-
},
61-
],
62-
},
63-
],
64-
},
11+
sectionFields(),
6512
{
6613
name: "variant",
6714
label: "Variant",

0 commit comments

Comments
 (0)