diff --git a/app/(pages)/hubspot/(components)/subscribe/subscribe.module.scss b/app/(pages)/hubspot/(components)/subscribe/subscribe.module.scss index 7d91803..929b0e7 100644 --- a/app/(pages)/hubspot/(components)/subscribe/subscribe.module.scss +++ b/app/(pages)/hubspot/(components)/subscribe/subscribe.module.scss @@ -31,12 +31,12 @@ border: 2px solid var(--black); border-radius: mobile-vw(8px); height: 100%; - width: mobile-vw(125px); + // width: mobile-vw(125px); @include desktop { border-radius: desktop-vw(8px); padding: 0 desktop-vw(24px); - width: desktop-vw(140px); + // width: desktop-vw(140px); } } diff --git a/app/(pages)/hubspot/hubspot.module.scss b/app/(pages)/hubspot/hubspot.module.scss index 59f23a3..37fc24c 100644 --- a/app/(pages)/hubspot/hubspot.module.scss +++ b/app/(pages)/hubspot/hubspot.module.scss @@ -24,11 +24,12 @@ .subscribe { margin-bottom: mobile-vw(31px); - width: mobile-vw(303px); + // width: mobile-vw(303px); + padding: 0 mobile-vw(15px); @include desktop { margin-bottom: desktop-vw(32px); - width: desktop-vw(362px); + // width: desktop-vw(362px); padding: 0 desktop-vw(15px); } } diff --git a/app/(pages)/storyblok/(component)/tutorial/index.js b/app/(pages)/storyblok/(component)/tutorial/index.js index 323720f..f2c52de 100644 --- a/app/(pages)/storyblok/(component)/tutorial/index.js +++ b/app/(pages)/storyblok/(component)/tutorial/index.js @@ -1,6 +1,6 @@ 'use client' -import { storyblokEditable } from '@storyblok/react' +import { storyblokEditable } from '@storyblok/js' import { useStoryblokContext } from 'libs/storyblok/context' import s from './tutorial.module.scss' @@ -12,9 +12,11 @@ import s from './tutorial.module.scss' export function Tutorial() { const { story } = useStoryblokContext() + const content = story?.content + return ( -
-

{story.content?.title}

+
+

{content?.title}

diff --git a/app/(pages)/storyblok/[slug]/(component)/article/article.module.scss b/app/(pages)/storyblok/[slug]/(component)/article/article.module.scss new file mode 100644 index 0000000..144bcdd --- /dev/null +++ b/app/(pages)/storyblok/[slug]/(component)/article/article.module.scss @@ -0,0 +1,6 @@ +.article { + display: flex; + flex-direction: column; + align-items: center; + gap: var(--layout-columns-gap); +} diff --git a/app/(pages)/storyblok/[slug]/(component)/article/index.js b/app/(pages)/storyblok/[slug]/(component)/article/index.js new file mode 100644 index 0000000..6050df6 --- /dev/null +++ b/app/(pages)/storyblok/[slug]/(component)/article/index.js @@ -0,0 +1,19 @@ +'use client' + +import { storyblokEditable } from '@storyblok/js' +import { useStoryblokContext } from 'libs/storyblok/context' +import s from './article.module.scss' + +export function Article() { + const { story } = useStoryblokContext() + + const content = story?.content + + if (!content) return + + return ( +
+

article: {content?.title}

+
+ ) +} diff --git a/app/(pages)/storyblok/[slug]/article-page.module.scss b/app/(pages)/storyblok/[slug]/article-page.module.scss new file mode 100644 index 0000000..8256d1b --- /dev/null +++ b/app/(pages)/storyblok/[slug]/article-page.module.scss @@ -0,0 +1,15 @@ +.page { + text-transform: uppercase; + font-family: var(--font-ibm-plex-mono); + + .inner { + display: flex; + align-items: center; + justify-content: center; + flex-grow: 1; + + @include mobile { + padding: 0 mobile-vw(16px); + } + } +} diff --git a/app/(pages)/storyblok/[slug]/page.js b/app/(pages)/storyblok/[slug]/page.js new file mode 100644 index 0000000..e66d7b4 --- /dev/null +++ b/app/(pages)/storyblok/[slug]/page.js @@ -0,0 +1,48 @@ +import { Wrapper } from 'app/(pages)/(components)/wrapper' +import { StoryblokApi } from 'libs/storyblok' +import { StoryblokContextProvider } from 'libs/storyblok/context' +import { draftMode } from 'next/headers' +import { notFound } from 'next/navigation' +import { Article } from './(component)/article' +import s from './article-page.module.scss' + +// https://nextjs.org/docs/app/api-reference/functions/generate-static-params + +export async function generateStaticParams() { + const { data } = await new StoryblokApi({ + draft: true, + }).get(`cdn/stories/`, { + starts_with: 'blog', + }) + + const stories = data?.stories + + return stories?.map(({ slug }) => ({ slug })) +} + +export default async function StoryblokSubPage({ params }) { + const isDraftMode = + draftMode().isEnabled || process.env.NODE_ENV === 'development' + + const { data } = await new StoryblokApi({ + draft: isDraftMode, + }) + .get(`cdn/stories/blog/${params.slug}`, { + resolve_relations: [], + }) + .catch(() => notFound()) + + const content = data?.story?.content + + if (!content) return + + return ( + + +
+
+
+
+
+ ) +} diff --git a/app/(pages)/storyblok/page.js b/app/(pages)/storyblok/page.js index bdf7554..9a80eca 100644 --- a/app/(pages)/storyblok/page.js +++ b/app/(pages)/storyblok/page.js @@ -1,6 +1,7 @@ import { StoryblokApi } from 'libs/storyblok' import { StoryblokContextProvider } from 'libs/storyblok/context' import { draftMode } from 'next/headers' +import { notFound } from 'next/navigation' import { Wrapper } from '../(components)/wrapper' import { Tutorial } from './(component)/tutorial' import s from './storyblok.module.scss' @@ -11,11 +12,17 @@ export default async function Storyblok() { const { data } = await new StoryblokApi({ draft: isDraftMode, - }).get('cdn/stories/home', { - resolve_relations: [], }) + .get('cdn/stories/home', { + resolve_relations: [], + }) + .catch(() => { + notFound() + }) - if (!data?.story) return + const content = data?.story?.content + + if (!content) return return ( diff --git a/package.json b/package.json index c38be49..c2dbce3 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "@radix-ui/react-select": "^2.0.0", "@react-three/drei": "^9.97.6", "@react-three/fiber": "^8.15.19", - "@storyblok/react": "^3.0.9", + "@storyblok/js": "^3.0.7", "@studio-freight/hamo": "0.6.28", "@studio-freight/react-lenis": "0.0.45", "@studio-freight/tempus": "^0.0.44", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 58d2ff9..a5e9dd8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,9 +24,9 @@ dependencies: '@react-three/fiber': specifier: ^8.15.19 version: 8.15.19(react-dom@18.2.0)(react@18.2.0)(three@0.161.0) - '@storyblok/react': - specifier: ^3.0.9 - version: 3.0.9(react-dom@18.2.0)(react@18.2.0) + '@storyblok/js': + specifier: ^3.0.7 + version: 3.0.7 '@studio-freight/hamo': specifier: 0.6.28 version: 0.6.28(react-dom@18.2.0)(react@18.2.0) @@ -2264,17 +2264,6 @@ packages: storyblok-js-client: 6.7.1 dev: false - /@storyblok/react@3.0.9(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-N362hE+sBH3QebCrJtqgzGI2l+Dre8hfNJmAJvEtx1bEtfvu6hcA5ch5eQjjILxgDMwtseA0BnCXP7zoqJ2KCg==} - peerDependencies: - react: 18.2.0 - react-dom: 18.2.0 - dependencies: - '@storyblok/js': 3.0.7 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - dev: false - /@studio-freight/hamo@0.6.28(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-LVXYJwPToVa4ZVIbFnicg8bmZF8xWebbdtx10/1HAQAjN8xGsTWAdc3BmUUOHtLWFvNJNLSuwdX24njrp7LF7g==} peerDependencies: diff --git a/public/sitemap-0.xml b/public/sitemap-0.xml deleted file mode 100644 index 034f019..0000000 --- a/public/sitemap-0.xml +++ /dev/null @@ -1,8 +0,0 @@ - - -https://satus.darkroom.engineering/robots.txt2024-03-12T16:15:42.539Zdaily0.7 -https://satus.darkroom.engineering/debug/orchestra2024-03-12T16:15:42.539Zdaily0.7 -https://satus.darkroom.engineering/r3f2024-03-12T16:15:42.539Zdaily0.7 -https://satus.darkroom.engineering2024-03-12T16:15:42.539Zdaily0.7 -https://satus.darkroom.engineering/tina2024-03-12T16:15:42.539Zdaily0.7 - \ No newline at end of file diff --git a/public/sitemap.xml b/public/sitemap.xml deleted file mode 100644 index f262ebf..0000000 --- a/public/sitemap.xml +++ /dev/null @@ -1,4 +0,0 @@ - - -https://satus.darkroom.engineering/sitemap-0.xml - \ No newline at end of file