diff --git a/docs/components/Markdown.tsx b/docs/components/Markdown.tsx index 43b2e9109f8..02b8aa3f663 100644 --- a/docs/components/Markdown.tsx +++ b/docs/components/Markdown.tsx @@ -45,13 +45,9 @@ export function Markdown({ ); } -export async function getServerSideProps() { +export async function getStaticProps() { const { readdirSync } = require('fs'); - const { normalize } = require('path'); - const dir = __dirname.endsWith('/server') - ? normalize(`${__dirname}/../../pages/releases`) - : normalize(`${__dirname}/../../../pages/releases`); - + const dir = __dirname.replace(/docs.+$/, 'docs/pages/releases'); const releases = (readdirSync(dir, 'utf8') as Array) .filter(name => !name.startsWith('.') && !name.startsWith('index')) .map(name => name.replace('.mdx', '')) diff --git a/docs/pages/releases/2021-03-22.mdx b/docs/pages/releases/2021-03-22.mdx index f9e9636ac18..61397a86cbb 100644 --- a/docs/pages/releases/2021-03-22.mdx +++ b/docs/pages/releases/2021-03-22.mdx @@ -1,4 +1,4 @@ -import { Markdown, getServerSideProps } from '../../components/Markdown'; +import { Markdown, getStaticProps } from '../../components/Markdown'; import { Emoji } from '../../components/primitives/Emoji'; # Release: 22nd March 2021 @@ -50,4 +50,4 @@ Now you can include negative values for `float`, `decimal` and `integer` fields. You can also view the [verbose release notes](https://github.com/keystonejs/keystone/releases/tag/2021-03-22) on GitHub. export default ({ children, ...props }) => {children}; -export { getServerSideProps } +export { getStaticProps } diff --git a/docs/pages/releases/2021-03-23.mdx b/docs/pages/releases/2021-03-23.mdx index cb792f3bdcb..4138c78c47c 100644 --- a/docs/pages/releases/2021-03-23.mdx +++ b/docs/pages/releases/2021-03-23.mdx @@ -1,4 +1,4 @@ -import { Markdown, getServerSideProps } from '../../components/Markdown'; +import { Markdown, getStaticProps } from '../../components/Markdown'; import { Emoji } from '../../components/primitives/Emoji'; # Release: 23rd March 2021 @@ -23,4 +23,4 @@ Mitchell [solved a bug](https://github.com/keystonejs/keystone/pull/5168) where You can also view the [verbose release notes](https://github.com/keystonejs/keystone/releases/tag/2021-03-23) on GitHub. export default ({ children, ...props }) => {children}; -export { getServerSideProps } +export { getStaticProps } diff --git a/docs/pages/releases/2021-03-30.mdx b/docs/pages/releases/2021-03-30.mdx index 082c8d8a92c..67bc3a29477 100644 --- a/docs/pages/releases/2021-03-30.mdx +++ b/docs/pages/releases/2021-03-30.mdx @@ -1,4 +1,4 @@ -import { Markdown, getServerSideProps } from '../../components/Markdown'; +import { Markdown, getStaticProps } from '../../components/Markdown'; import { Emoji } from '../../components/primitives/Emoji'; # Release: 30th March 2021 @@ -44,4 +44,4 @@ We fixed a bug that existed in `updateMany` on lists with declarative access con You can also view the [verbose release notes](https://github.com/keystonejs/keystone/releases/tag/2021-03-30) on GitHub. export default ({ children, ...props }) => {children}; -export { getServerSideProps } +export { getStaticProps } diff --git a/docs/pages/releases/2021-04-06.mdx b/docs/pages/releases/2021-04-06.mdx index 3255807b507..659f1428147 100644 --- a/docs/pages/releases/2021-04-06.mdx +++ b/docs/pages/releases/2021-04-06.mdx @@ -1,4 +1,4 @@ -import { Markdown, getServerSideProps } from '../../components/Markdown'; +import { Markdown, getStaticProps } from '../../components/Markdown'; import { Emoji } from '../../components/primitives/Emoji'; # Release: 6th April 2021 @@ -38,4 +38,4 @@ Pagination in the Admin UI has fresh styles and is easier to use. You can also view the [verbose release notes](https://github.com/keystonejs/keystone/releases/tag/2021-04-06) on GitHub. export default ({ children, ...props }) => {children}; -export { getServerSideProps } +export { getStaticProps } diff --git a/docs/pages/releases/2021-04-20.mdx b/docs/pages/releases/2021-04-20.mdx index 728d313d133..3dae3c770ff 100644 --- a/docs/pages/releases/2021-04-20.mdx +++ b/docs/pages/releases/2021-04-20.mdx @@ -1,4 +1,4 @@ -import { Markdown, getServerSideProps } from '../../components/Markdown'; +import { Markdown, getStaticProps } from '../../components/Markdown'; # Release: 20th April 2021 @@ -60,4 +60,4 @@ const [post] = await context.db.lists.Post.findMany({ You can also view the [verbose release notes](https://github.com/keystonejs/keystone/releases/tag/2021-04-20) on GitHub. export default ({ children, ...props }) => {children}; -export { getServerSideProps } +export { getStaticProps } diff --git a/docs/pages/releases/2021-05-03.mdx b/docs/pages/releases/2021-05-03.mdx index 8c8586ebe81..d701f6a165a 100644 --- a/docs/pages/releases/2021-05-03.mdx +++ b/docs/pages/releases/2021-05-03.mdx @@ -1,4 +1,4 @@ -import { Markdown, getServerSideProps } from '../../components/Markdown'; +import { Markdown, getStaticProps } from '../../components/Markdown'; import { Emoji } from '../../components/primitives/Emoji'; # Release: 3rd May 2021 @@ -27,4 +27,4 @@ This release involved a bunch of busywork behind the scenes in Keystone 6. Strip You can also view the [verbose release notes](https://github.com/keystonejs/keystone/releases/tag/2021-05-03) on GitHub. export default ({ children, ...props }) => {children}; -export { getServerSideProps } +export { getStaticProps } diff --git a/docs/pages/releases/2021-05-05.mdx b/docs/pages/releases/2021-05-05.mdx index 35fcb410e35..13b7458d10e 100644 --- a/docs/pages/releases/2021-05-05.mdx +++ b/docs/pages/releases/2021-05-05.mdx @@ -1,4 +1,4 @@ -import { Markdown, getServerSideProps } from '../../components/Markdown'; +import { Markdown, getStaticProps } from '../../components/Markdown'; import { Emoji } from '../../components/primitives/Emoji'; # Release: 5th May 2021 @@ -20,4 +20,4 @@ If you look closely you’ll see the core team working on example projects to sh You can also view the [verbose release notes](https://github.com/keystonejs/keystone/releases/tag/2021-05-05) on GitHub. export default ({ children, ...props }) => {children}; -export { getServerSideProps } +export { getStaticProps } diff --git a/docs/pages/releases/2021-05-11.mdx b/docs/pages/releases/2021-05-11.mdx index 44463a14382..c1d075c405c 100644 --- a/docs/pages/releases/2021-05-11.mdx +++ b/docs/pages/releases/2021-05-11.mdx @@ -1,4 +1,4 @@ -import { Markdown, getServerSideProps } from '../../components/Markdown'; +import { Markdown, getStaticProps } from '../../components/Markdown'; import { Emoji } from '../../components/primitives/Emoji'; # Release: 11th May 2021 @@ -21,4 +21,4 @@ A bunch of admin UI tweaks in this release, among other minor fixes. We also hav You can also view the [verbose release notes](https://github.com/keystonejs/keystone/releases/tag/2021-05-11) on GitHub. export default ({ children, ...props }) => {children}; -export { getServerSideProps } +export { getStaticProps } diff --git a/docs/pages/releases/2021-05-17.mdx b/docs/pages/releases/2021-05-17.mdx index d64a04de378..a3cf8d2f729 100644 --- a/docs/pages/releases/2021-05-17.mdx +++ b/docs/pages/releases/2021-05-17.mdx @@ -1,4 +1,4 @@ -import { Markdown, getServerSideProps } from '../../components/Markdown'; +import { Markdown, getStaticProps } from '../../components/Markdown'; import { Emoji } from '../../components/primitives/Emoji'; # Release: 17th May 2021 @@ -24,4 +24,4 @@ Thanks to @cameronbraid for spotting a [session issue](https://github.com/keysto You can also view the [verbose release notes](https://github.com/keystonejs/keystone/releases/tag/2021-05-17) on GitHub. export default ({ children, ...props }) => {children}; -export { getServerSideProps } +export { getStaticProps } diff --git a/docs/pages/releases/2021-05-19.mdx b/docs/pages/releases/2021-05-19.mdx index 17fb68d746c..86e646e5ad7 100644 --- a/docs/pages/releases/2021-05-19.mdx +++ b/docs/pages/releases/2021-05-19.mdx @@ -1,4 +1,4 @@ -import { Markdown, getServerSideProps } from '../../components/Markdown'; +import { Markdown, getStaticProps } from '../../components/Markdown'; import { Emoji } from '../../components/primitives/Emoji'; # Release: 19th May 2021 @@ -35,4 +35,4 @@ If you were directly importing from `@keystone-next/admin-ui` you can now import You can also view the [verbose release notes](https://github.com/keystonejs/keystone/releases/tag/2021-05-19) on GitHub. export default ({ children, ...props }) => {children}; -export { getServerSideProps } +export { getStaticProps } diff --git a/docs/pages/releases/2021-06-02.mdx b/docs/pages/releases/2021-06-02.mdx index e5d3e8e1dbb..42dc7d7f6cf 100644 --- a/docs/pages/releases/2021-06-02.mdx +++ b/docs/pages/releases/2021-06-02.mdx @@ -1,4 +1,4 @@ -import { Markdown, getServerSideProps } from '../../components/Markdown'; +import { Markdown, getStaticProps } from '../../components/Markdown'; import { Emoji } from '../../components/primitives/Emoji'; # Release: 2nd June 2021 @@ -184,4 +184,4 @@ We've updated our Prisma dependency from `2.22.1` to `2.24.0`! Check out the [Pr You can also view the [verbose release notes](https://github.com/keystonejs/keystone/releases/tag/2021-06-02) on GitHub. export default ({ children, ...props }) => {children}; -export { getServerSideProps } +export { getStaticProps } diff --git a/docs/pages/releases/2021-06-15.mdx b/docs/pages/releases/2021-06-15.mdx index 6e04474584d..cd3639e4206 100644 --- a/docs/pages/releases/2021-06-15.mdx +++ b/docs/pages/releases/2021-06-15.mdx @@ -1,4 +1,4 @@ -import { Markdown, getServerSideProps } from '../../components/Markdown'; +import { Markdown, getStaticProps } from '../../components/Markdown'; import { Emoji } from '../../components/primitives/Emoji'; # Release: 15th June 2021 @@ -93,4 +93,4 @@ We've updated our Prisma dependencies to `2.24.1`, check out the [Prisma release You can also view the [verbose release notes](https://github.com/keystonejs/keystone/releases/tag/2021-06-15) on GitHub. export default ({ children, ...props }) => {children}; -export { getServerSideProps } +export { getStaticProps } diff --git a/docs/pages/releases/2021-06-28.mdx b/docs/pages/releases/2021-06-28.mdx index a1f85f4fe5a..4a6d7ccebc7 100644 --- a/docs/pages/releases/2021-06-28.mdx +++ b/docs/pages/releases/2021-06-28.mdx @@ -1,4 +1,4 @@ -import { Markdown, getServerSideProps } from '../../components/Markdown'; +import { Markdown, getStaticProps } from '../../components/Markdown'; import { Emoji } from '../../components/primitives/Emoji'; # Release: 28th June 2021 @@ -64,4 +64,4 @@ We've updated our Prisma dependencies to `2.25.0`, check out the [Prisma release You can also view the [verbose release notes](https://github.com/keystonejs/keystone/releases/tag/2021-06-28) on GitHub. export default ({ children, ...props }) => {children}; -export { getServerSideProps } +export { getStaticProps } diff --git a/docs/pages/releases/2021-06-29.mdx b/docs/pages/releases/2021-06-29.mdx index a140e784a92..399ce1a5aab 100644 --- a/docs/pages/releases/2021-06-29.mdx +++ b/docs/pages/releases/2021-06-29.mdx @@ -1,4 +1,4 @@ -import { Markdown, getServerSideProps } from '../../components/Markdown'; +import { Markdown, getStaticProps } from '../../components/Markdown'; import { Emoji } from '../../components/primitives/Emoji'; # Release: 29th June 2021 @@ -64,4 +64,4 @@ config({ You can also view the [verbose release notes](https://github.com/keystonejs/keystone/releases/tag/2021-06-29) on GitHub. export default ({ children, ...props }) => {children}; -export { getServerSideProps } +export { getStaticProps } diff --git a/docs/pages/releases/2021-06-30.mdx b/docs/pages/releases/2021-06-30.mdx index b8bf531d523..abfedc3d0e2 100644 --- a/docs/pages/releases/2021-06-30.mdx +++ b/docs/pages/releases/2021-06-30.mdx @@ -1,4 +1,4 @@ -import { Markdown, getServerSideProps } from '../../components/Markdown'; +import { Markdown, getStaticProps } from '../../components/Markdown'; import { Emoji } from '../../components/primitives/Emoji'; # Release: 30th June 2021 @@ -23,4 +23,4 @@ We've discovered an issue where `cloudinaryImage` and `relationship` fields were You can also view the [verbose release notes](https://github.com/keystonejs/keystone/releases/tag/2021-06-30) on GitHub. export default ({ children, ...props }) => {children}; -export { getServerSideProps } +export { getStaticProps } diff --git a/docs/pages/releases/2021-07-13.mdx b/docs/pages/releases/2021-07-13.mdx index a5c1569c921..5e84262da4f 100644 --- a/docs/pages/releases/2021-07-13.mdx +++ b/docs/pages/releases/2021-07-13.mdx @@ -1,4 +1,4 @@ -import { Markdown, getServerSideProps } from '../../components/Markdown'; +import { Markdown, getStaticProps } from '../../components/Markdown'; import { Emoji } from '../../components/primitives/Emoji'; # Release: 13th July 2021 @@ -69,4 +69,4 @@ Our `packages-next` folder has moved over to `packages` as part of our push to a You can also view the [verbose release notes](https://github.com/keystonejs/keystone/releases/tag/2021-07-13) on GitHub. export default ({ children, ...props }) => {children}; -export { getServerSideProps } +export { getStaticProps } diff --git a/docs/pages/releases/2021-07-29.mdx b/docs/pages/releases/2021-07-29.mdx index b4a23c1902e..007b1aa015c 100644 --- a/docs/pages/releases/2021-07-29.mdx +++ b/docs/pages/releases/2021-07-29.mdx @@ -1,4 +1,4 @@ -import { Markdown, getServerSideProps } from '../../components/Markdown'; +import { Markdown, getStaticProps } from '../../components/Markdown'; import { Emoji } from '../../components/primitives/Emoji'; # Release: 29th July 2021 @@ -97,4 +97,4 @@ Updated Prisma dependencies to `2.27.0`, check out the [Prisma releases page](ht You can also view the [verbose release notes](https://github.com/keystonejs/keystone/releases/tag/2021-07-29) on GitHub. export default ({ children, ...props }) => {children}; -export { getServerSideProps } +export { getStaticProps } diff --git a/docs/pages/releases/index.mdx b/docs/pages/releases/index.mdx index 67512ebed1e..538727144f1 100644 --- a/docs/pages/releases/index.mdx +++ b/docs/pages/releases/index.mdx @@ -1,4 +1,4 @@ -import { Markdown, getServerSideProps } from '../../components/Markdown'; +import { Markdown, getStaticProps } from '../../components/Markdown'; import { Emoji } from '../../components/primitives/Emoji'; import { Status } from '../../components/primitives/Status'; @@ -79,4 +79,4 @@ Prisma migrations , Noteworthy bug-squashing < ?> 🔎 You can also find all the **Keystone 6** releases on [GitHub](https://github.com/keystonejs/keystone/releases)! export default ({ children, ...props }) => {children}; -export { getServerSideProps } +export { getStaticProps } diff --git a/docs/pages/updates/index.tsx b/docs/pages/updates/index.tsx index b15ff603327..a26302df2fd 100644 --- a/docs/pages/updates/index.tsx +++ b/docs/pages/updates/index.tsx @@ -3,7 +3,7 @@ import { HTMLAttributes, ReactNode } from 'react'; import { jsx } from '@emotion/react'; import Link from 'next/link'; -import { getServerSideProps } from '../../components/Markdown'; +import { getStaticProps } from '../../components/Markdown'; import { InlineCode } from '../../components/primitives/Code'; import { Button } from '../../components/primitives/Button'; import { Alert } from '../../components/primitives/Alert'; @@ -190,7 +190,7 @@ export default function WhatsNew() { frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen - > + /> Follow along in with the repo @@ -247,7 +247,7 @@ export default function WhatsNew() { frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen - > + /> @@ -397,4 +397,4 @@ export default function WhatsNew() { ); } -export { getServerSideProps }; +export { getStaticProps }; diff --git a/docs/pages/updates/prisma-day-2021.mdx b/docs/pages/updates/prisma-day-2021.mdx index 38cb1c75b41..56b736058c4 100644 --- a/docs/pages/updates/prisma-day-2021.mdx +++ b/docs/pages/updates/prisma-day-2021.mdx @@ -1,4 +1,4 @@ -import { Markdown, getServerSideProps } from '../../components/Markdown'; +import { Markdown, getStaticProps } from '../../components/Markdown'; # Prisma Day 2021 Talk @@ -110,4 +110,4 @@ So this is our take on what that looks like. I'd love you to check it out, let u Thanks for having me. export default ({ children, ...props }) => {children}; -export { getServerSideProps } +export { getStaticProps } diff --git a/docs/pages/updates/roadmap.tsx b/docs/pages/updates/roadmap.tsx index b0831f18c8e..6a66741b49b 100644 --- a/docs/pages/updates/roadmap.tsx +++ b/docs/pages/updates/roadmap.tsx @@ -2,7 +2,7 @@ import { ComponentProps, Fragment, ReactNode } from 'react'; import { jsx } from '@emotion/react'; -import { getServerSideProps } from '../../components/Markdown'; +import { getStaticProps } from '../../components/Markdown'; import { InlineCode } from '../../components/primitives/Code'; import { Button } from '../../components/primitives/Button'; import { Highlight } from '../../components/primitives/Highlight'; @@ -416,4 +416,4 @@ export default function Roadmap() { ); } -export { getServerSideProps }; +export { getStaticProps }; diff --git a/docs/pages/updates/whats-new-in-v6.mdx b/docs/pages/updates/whats-new-in-v6.mdx index f790b456ba9..87c87363cc1 100644 --- a/docs/pages/updates/whats-new-in-v6.mdx +++ b/docs/pages/updates/whats-new-in-v6.mdx @@ -1,4 +1,4 @@ -import { Markdown, getServerSideProps } from '../../components/Markdown'; +import { Markdown, getStaticProps } from '../../components/Markdown'; import { SubscribeForm } from '../../components/SubscribeForm'; import { Badge } from '../../components/primitives/Badge'; import { Emoji } from '../../components/primitives/Emoji'; @@ -58,4 +58,4 @@ We also have new reference examples for how to use advanced features, like imple roles-based access control system. export default ({ children, ...props }) => {children}; -export { getServerSideProps } +export { getStaticProps }