Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: initial changes to support case study pages

Jonathan Summers-Muirb043ed175e9d
diff --git a/www/_case-studies/xendit copy 2.mdx b/www/_case-studies/xendit copy 2.mdx
new file mode 100644
index 00000000000..c7d0bbc1354
--- /dev/null
+++ b/www/_case-studies/xendit copy 2.mdx
@@ -0,0 +1,39 @@
+---
+title: Xendit
+description: Two months of building
+author: rory_wilding
+author_title: Supabase
+author_url: https://github.com/kiwicopple
+author_image_url: https://avatars2.githubusercontent.com/u/10214025?s=400&u=c6775be2ae667e2acae3ccd347fed62bb3f5b3e7&v=4
+authorURL: https://github.com/kiwicopple
+logo: /images/case-studies/logos/xendit.png
+tags:
+ - supabase
+date: '28-10-2020'
+stats:
+ [
+ { stat: '20,000', label: Number of employees },
+ { stat: '10', label: Number of offices },
+ { stat: '$1M', label: Annual revenue },
+ ]
+misc: [{ label: 'Founded', text: San Francisco }]
+about: Vercel combines the best developer experience with an obsessive focus on end-user performance. Our platform enables frontend teams to do their best work.
+---
+
+### Challenge
+
+As a payment processor, Xendit are responsible for verifying that all transactions are legal. Any transactions which are suspicions must be verified against a strict set of criteria, and the parties involved need to be checked against international sanctions lists. This is a critical anti-money-laundering operation and needs to be performed in realtime to prevent any delays on legitimate payments.
+
+### Why they chose Supabase
+
+Xendit needed something fast. Something that was cheaper than using the global players like Worldcheck or Refinitiv. Xendit already uses Postgres for a lot of their critical infrastructure, and so Xendit team are familiar with the technology and comfortable in it's ability to scale.
+
+### What they built
+
+Xendit parses international sanctions lists from the UN and the Indonesian government and loads them into Supabase. Since Supabase provides a full Postgres server, they can then use the [Trigram](https://www.postgresql.org/docs/current/pgtrgm.html) extension to perform full-text search on the lists, with a relevance score on every search.
+
+Supabase was perfect for their use case, as they needed something built fast. The full solution was built and in production in less than one week.
+
+> The full solution was built and in production in less than one week.
+
+Xendit created a database function for searching, which they are able to call directly using their Python clients. They have plans to iterate on the current implementation using more advanced techniques, like machine learning, but for now the Supabase system has been in Production for 9 months without a problem.
diff --git a/www/_case-studies/xendit copy 3.mdx b/www/_case-studies/xendit copy 3.mdx
new file mode 100644
index 00000000000..c7d0bbc1354
--- /dev/null
+++ b/www/_case-studies/xendit copy 3.mdx
@@ -0,0 +1,39 @@
+---
+title: Xendit
+description: Two months of building
+author: rory_wilding
+author_title: Supabase
+author_url: https://github.com/kiwicopple
+author_image_url: https://avatars2.githubusercontent.com/u/10214025?s=400&u=c6775be2ae667e2acae3ccd347fed62bb3f5b3e7&v=4
+authorURL: https://github.com/kiwicopple
+logo: /images/case-studies/logos/xendit.png
+tags:
+ - supabase
+date: '28-10-2020'
+stats:
+ [
+ { stat: '20,000', label: Number of employees },
+ { stat: '10', label: Number of offices },
+ { stat: '$1M', label: Annual revenue },
+ ]
+misc: [{ label: 'Founded', text: San Francisco }]
+about: Vercel combines the best developer experience with an obsessive focus on end-user performance. Our platform enables frontend teams to do their best work.
+---
+
+### Challenge
+
+As a payment processor, Xendit are responsible for verifying that all transactions are legal. Any transactions which are suspicions must be verified against a strict set of criteria, and the parties involved need to be checked against international sanctions lists. This is a critical anti-money-laundering operation and needs to be performed in realtime to prevent any delays on legitimate payments.
+
+### Why they chose Supabase
+
+Xendit needed something fast. Something that was cheaper than using the global players like Worldcheck or Refinitiv. Xendit already uses Postgres for a lot of their critical infrastructure, and so Xendit team are familiar with the technology and comfortable in it's ability to scale.
+
+### What they built
+
+Xendit parses international sanctions lists from the UN and the Indonesian government and loads them into Supabase. Since Supabase provides a full Postgres server, they can then use the [Trigram](https://www.postgresql.org/docs/current/pgtrgm.html) extension to perform full-text search on the lists, with a relevance score on every search.
+
+Supabase was perfect for their use case, as they needed something built fast. The full solution was built and in production in less than one week.
+
+> The full solution was built and in production in less than one week.
+
+Xendit created a database function for searching, which they are able to call directly using their Python clients. They have plans to iterate on the current implementation using more advanced techniques, like machine learning, but for now the Supabase system has been in Production for 9 months without a problem.
diff --git a/www/_case-studies/xendit copy 4.mdx b/www/_case-studies/xendit copy 4.mdx
new file mode 100644
index 00000000000..c7d0bbc1354
--- /dev/null
+++ b/www/_case-studies/xendit copy 4.mdx
@@ -0,0 +1,39 @@
+---
+title: Xendit
+description: Two months of building
+author: rory_wilding
+author_title: Supabase
+author_url: https://github.com/kiwicopple
+author_image_url: https://avatars2.githubusercontent.com/u/10214025?s=400&u=c6775be2ae667e2acae3ccd347fed62bb3f5b3e7&v=4
+authorURL: https://github.com/kiwicopple
+logo: /images/case-studies/logos/xendit.png
+tags:
+ - supabase
+date: '28-10-2020'
+stats:
+ [
+ { stat: '20,000', label: Number of employees },
+ { stat: '10', label: Number of offices },
+ { stat: '$1M', label: Annual revenue },
+ ]
+misc: [{ label: 'Founded', text: San Francisco }]
+about: Vercel combines the best developer experience with an obsessive focus on end-user performance. Our platform enables frontend teams to do their best work.
+---
+
+### Challenge
+
+As a payment processor, Xendit are responsible for verifying that all transactions are legal. Any transactions which are suspicions must be verified against a strict set of criteria, and the parties involved need to be checked against international sanctions lists. This is a critical anti-money-laundering operation and needs to be performed in realtime to prevent any delays on legitimate payments.
+
+### Why they chose Supabase
+
+Xendit needed something fast. Something that was cheaper than using the global players like Worldcheck or Refinitiv. Xendit already uses Postgres for a lot of their critical infrastructure, and so Xendit team are familiar with the technology and comfortable in it's ability to scale.
+
+### What they built
+
+Xendit parses international sanctions lists from the UN and the Indonesian government and loads them into Supabase. Since Supabase provides a full Postgres server, they can then use the [Trigram](https://www.postgresql.org/docs/current/pgtrgm.html) extension to perform full-text search on the lists, with a relevance score on every search.
+
+Supabase was perfect for their use case, as they needed something built fast. The full solution was built and in production in less than one week.
+
+> The full solution was built and in production in less than one week.
+
+Xendit created a database function for searching, which they are able to call directly using their Python clients. They have plans to iterate on the current implementation using more advanced techniques, like machine learning, but for now the Supabase system has been in Production for 9 months without a problem.
diff --git a/www/_case-studies/xendit copy 5.mdx b/www/_case-studies/xendit copy 5.mdx
new file mode 100644
index 00000000000..c7d0bbc1354
--- /dev/null
+++ b/www/_case-studies/xendit copy 5.mdx
@@ -0,0 +1,39 @@
+---
+title: Xendit
+description: Two months of building
+author: rory_wilding
+author_title: Supabase
+author_url: https://github.com/kiwicopple
+author_image_url: https://avatars2.githubusercontent.com/u/10214025?s=400&u=c6775be2ae667e2acae3ccd347fed62bb3f5b3e7&v=4
+authorURL: https://github.com/kiwicopple
+logo: /images/case-studies/logos/xendit.png
+tags:
+ - supabase
+date: '28-10-2020'
+stats:
+ [
+ { stat: '20,000', label: Number of employees },
+ { stat: '10', label: Number of offices },
+ { stat: '$1M', label: Annual revenue },
+ ]
+misc: [{ label: 'Founded', text: San Francisco }]
+about: Vercel combines the best developer experience with an obsessive focus on end-user performance. Our platform enables frontend teams to do their best work.
+---
+
+### Challenge
+
+As a payment processor, Xendit are responsible for verifying that all transactions are legal. Any transactions which are suspicions must be verified against a strict set of criteria, and the parties involved need to be checked against international sanctions lists. This is a critical anti-money-laundering operation and needs to be performed in realtime to prevent any delays on legitimate payments.
+
+### Why they chose Supabase
+
+Xendit needed something fast. Something that was cheaper than using the global players like Worldcheck or Refinitiv. Xendit already uses Postgres for a lot of their critical infrastructure, and so Xendit team are familiar with the technology and comfortable in it's ability to scale.
+
+### What they built
+
+Xendit parses international sanctions lists from the UN and the Indonesian government and loads them into Supabase. Since Supabase provides a full Postgres server, they can then use the [Trigram](https://www.postgresql.org/docs/current/pgtrgm.html) extension to perform full-text search on the lists, with a relevance score on every search.
+
+Supabase was perfect for their use case, as they needed something built fast. The full solution was built and in production in less than one week.
+
+> The full solution was built and in production in less than one week.
+
+Xendit created a database function for searching, which they are able to call directly using their Python clients. They have plans to iterate on the current implementation using more advanced techniques, like machine learning, but for now the Supabase system has been in Production for 9 months without a problem.
diff --git a/www/_case-studies/xendit copy.mdx b/www/_case-studies/xendit copy.mdx
new file mode 100644
index 00000000000..c7d0bbc1354
--- /dev/null
+++ b/www/_case-studies/xendit copy.mdx
@@ -0,0 +1,39 @@
+---
+title: Xendit
+description: Two months of building
+author: rory_wilding
+author_title: Supabase
+author_url: https://github.com/kiwicopple
+author_image_url: https://avatars2.githubusercontent.com/u/10214025?s=400&u=c6775be2ae667e2acae3ccd347fed62bb3f5b3e7&v=4
+authorURL: https://github.com/kiwicopple
+logo: /images/case-studies/logos/xendit.png
+tags:
+ - supabase
+date: '28-10-2020'
+stats:
+ [
+ { stat: '20,000', label: Number of employees },
+ { stat: '10', label: Number of offices },
+ { stat: '$1M', label: Annual revenue },
+ ]
+misc: [{ label: 'Founded', text: San Francisco }]
+about: Vercel combines the best developer experience with an obsessive focus on end-user performance. Our platform enables frontend teams to do their best work.
+---
+
+### Challenge
+
+As a payment processor, Xendit are responsible for verifying that all transactions are legal. Any transactions which are suspicions must be verified against a strict set of criteria, and the parties involved need to be checked against international sanctions lists. This is a critical anti-money-laundering operation and needs to be performed in realtime to prevent any delays on legitimate payments.
+
+### Why they chose Supabase
+
+Xendit needed something fast. Something that was cheaper than using the global players like Worldcheck or Refinitiv. Xendit already uses Postgres for a lot of their critical infrastructure, and so Xendit team are familiar with the technology and comfortable in it's ability to scale.
+
+### What they built
+
+Xendit parses international sanctions lists from the UN and the Indonesian government and loads them into Supabase. Since Supabase provides a full Postgres server, they can then use the [Trigram](https://www.postgresql.org/docs/current/pgtrgm.html) extension to perform full-text search on the lists, with a relevance score on every search.
+
+Supabase was perfect for their use case, as they needed something built fast. The full solution was built and in production in less than one week.
+
+> The full solution was built and in production in less than one week.
+
+Xendit created a database function for searching, which they are able to call directly using their Python clients. They have plans to iterate on the current implementation using more advanced techniques, like machine learning, but for now the Supabase system has been in Production for 9 months without a problem.
diff --git a/www/_case-studies/xendit.mdx b/www/_case-studies/xendit.mdx
new file mode 100644
index 00000000000..c7d0bbc1354
--- /dev/null
+++ b/www/_case-studies/xendit.mdx
@@ -0,0 +1,39 @@
+---
+title: Xendit
+description: Two months of building
+author: rory_wilding
+author_title: Supabase
+author_url: https://github.com/kiwicopple
+author_image_url: https://avatars2.githubusercontent.com/u/10214025?s=400&u=c6775be2ae667e2acae3ccd347fed62bb3f5b3e7&v=4
+authorURL: https://github.com/kiwicopple
+logo: /images/case-studies/logos/xendit.png
+tags:
+ - supabase
+date: '28-10-2020'
+stats:
+ [
+ { stat: '20,000', label: Number of employees },
+ { stat: '10', label: Number of offices },
+ { stat: '$1M', label: Annual revenue },
+ ]
+misc: [{ label: 'Founded', text: San Francisco }]
+about: Vercel combines the best developer experience with an obsessive focus on end-user performance. Our platform enables frontend teams to do their best work.
+---
+
+### Challenge
+
+As a payment processor, Xendit are responsible for verifying that all transactions are legal. Any transactions which are suspicions must be verified against a strict set of criteria, and the parties involved need to be checked against international sanctions lists. This is a critical anti-money-laundering operation and needs to be performed in realtime to prevent any delays on legitimate payments.
+
+### Why they chose Supabase
+
+Xendit needed something fast. Something that was cheaper than using the global players like Worldcheck or Refinitiv. Xendit already uses Postgres for a lot of their critical infrastructure, and so Xendit team are familiar with the technology and comfortable in it's ability to scale.
+
+### What they built
+
+Xendit parses international sanctions lists from the UN and the Indonesian government and loads them into Supabase. Since Supabase provides a full Postgres server, they can then use the [Trigram](https://www.postgresql.org/docs/current/pgtrgm.html) extension to perform full-text search on the lists, with a relevance score on every search.
+
+Supabase was perfect for their use case, as they needed something built fast. The full solution was built and in production in less than one week.
+
+> The full solution was built and in production in less than one week.
+
+Xendit created a database function for searching, which they are able to call directly using their Python clients. They have plans to iterate on the current implementation using more advanced techniques, like machine learning, but for now the Supabase system has been in Production for 9 months without a problem.
diff --git a/www/_casestudies/vercel.mdx b/www/_casestudies/vercel.mdx
deleted file mode 100644
index 5bf93d49196..00000000000
--- a/www/_casestudies/vercel.mdx
+++ /dev/null
@@ -1,30 +0,0 @@
----
-title: Vercel
-description: Two months of building
-author: rory_wilding
-author_title: Supabase
-author_url: https://github.com/kiwicopple
-author_image_url: https://avatars2.githubusercontent.com/u/10214025?s=400&u=c6775be2ae667e2acae3ccd347fed62bb3f5b3e7&v=4
-authorURL: https://github.com/kiwicopple
-company_logo:
-tags:
- - supabase
-date: '28-10-2020'
----
-
-Now in [Supabase](https://app.supabase.io):
-
-- Set up Postgres in less than 2 minutes
-- Auto-generated APIs! (they are a bit flaky, go easy)
-- Query your database directly from the dashboard
-- Analyze your queries and make them faster :rocket:
-
-<iframe
- className="w-full"
- width="700"
- height="350"
- src="https://www.youtube-nocookie.com/embed/ck5MM_PD4Co"
- frameBorder="0"
- allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
- allowfullscreen
-></iframe>
diff --git a/www/components/ImageGrid.tsx b/www/components/ImageGrid.tsx
index 9283d82a1a1..ee0604954c4 100644
--- a/www/components/ImageGrid.tsx
+++ b/www/components/ImageGrid.tsx
@@ -1,22 +1,34 @@
import { useRouter } from 'next/router'
import Image from 'next/image'
+import Link from 'next/link'
interface iImages {
name: string
image: string
alt?: string
+ link?: string
}
type colSizes = 8 | 6 | 4 | 3
+type paddingSizes = 6 | 8 | 12
interface iImageGrid {
images: iImages[]
smCols?: colSizes
mdCols?: colSizes
lgCols?: colSizes
+ padding?: paddingSizes
+ className?: string
}
-const ImageGrid = ({ images, smCols = 3, mdCols = 6, lgCols = 8 }: iImageGrid) => {
+const ImageGrid = ({
+ images,
+ smCols = 3,
+ mdCols = 6,
+ lgCols = 8,
+ padding = 8,
+ className,
+}: iImageGrid) => {
const smBreakpoint = {
3: 'grid-cols-3',
4: 'grid-cols-4',
@@ -38,6 +50,12 @@ const ImageGrid = ({ images, smCols = 3, mdCols = 6, lgCols = 8 }: iImageGrid) =
8: 'lg:grid-cols-8',
}
+ const imgPadding = {
+ 6: 'h-6 ',
+ 8: 'h-8 ',
+ 12: 'h-12 ',
+ }
+
return (
<div
className={`grid
@@ -48,27 +66,54 @@ const ImageGrid = ({ images, smCols = 3, mdCols = 6, lgCols = 8 }: iImageGrid) =
`}
>
{images.map((x, i) => {
+ const Container = ({ children, link }: any) => {
+ if (x.link) {
+ return (
+ <Link href={link}>
+ <div className="cursor-pointer transform duration-100 ease-in-out scale-100 hover:scale-105 hover:shadow-sm hover:z-50">
+ {children}
+ </div>
+ </Link>
+ )
+ } else {
+ return children
+ }
+ }
+
return (
- <div
- key={`${x.name}-${i}`}
- className="col-span-1 flex items-center justify-center bg-gray-50 dark:bg-gray-700 p-8"
- >
- <div className="relative overflow-auto w-full h-8 p-8">
- <Image
- layout="fill"
- src={`${x.image}`}
- alt={x.alt}
- objectFit="scale-down"
- objectPosition="center"
- className="
+ <>
+ <Container link={x.link}>
+ <div
+ key={`${x.name}-${i}`}
+ className={`
+ col-span-1 flex items-center justify-center
+ bg-gray-50
+ dark:bg-gray-700
+ ${x.link && 'hover:bg-gray-100 dark:hover:bg-gray-600'}
+ p-8 ${className}`}
+ >
+ <div
+ className={`relative overflow-auto w-full h-8
+ ${imgPadding[padding]}
+ `}
+ >
+ <Image
+ layout="fill"
+ src={`${x.image}`}
+ alt={x.alt}
+ objectFit="scale-down"
+ objectPosition="center"
+ className="
bg-no-repeat
filter
contrast-0
opacity-50
"
- />
- </div>
- </div>
+ />
+ </div>
+ </div>
+ </Container>
+ </>
)
})}
</div>
diff --git a/www/lib/posts.tsx b/www/lib/posts.tsx
index fc5b4bb025a..27c0a998491 100644
--- a/www/lib/posts.tsx
+++ b/www/lib/posts.tsx
@@ -7,7 +7,9 @@ import { generateReadingTime } from './helpers'
// based on YYYY-MM-DD format
const FILENAME_SUBSTRING = 11
-export const getSortedPosts = (directory: string, limit?: number, tags?: any) => {
+type Directories = '_blog' | '_case-studies'
+
+export const getSortedPosts = (directory: Directories, limit?: number, tags?: any) => {
//Finding directory named "blog" from the current working directory of Node.
const postDirectory = path.join(process.cwd(), directory)
@@ -18,8 +20,11 @@ export const getSortedPosts = (directory: string, limit?: number, tags?: any) =>
let allPostsData = fileNames.map((filename) => {
const slug = filename.replace('.mdx', '')
+ // console.log('slug', slug)
const fullPath = path.join(postDirectory, filename)
+ // console.log('fullPath', fullPath)
+
//Extracts contents of the MDX file
const fileContents = fs.readFileSync(fullPath, 'utf8')
const { data, content } = matter(fileContents)
@@ -28,11 +33,17 @@ export const getSortedPosts = (directory: string, limit?: number, tags?: any) =>
const formattedDate = new Date(data.date).toLocaleDateString('en-IN', options)
const readingTime = generateReadingTime(content)
- const dates = getDatesFromFileName(filename)
// construct url to link to blog posts
// based on datestamp in file name
- const url = `${dates.year}/${dates.month}/${dates.day}/${slug.substring(FILENAME_SUBSTRING)}`
+ let url = ''
+ if (directory === '_blog') {
+ const dates = getDatesFromFileName(filename)
+ url = `${dates.year}/${dates.month}/${dates.day}/${slug.substring(FILENAME_SUBSTRING)}`
+ } else {
+ // console.log(slug.substring(FILENAME_SUBSTRING))
+ url = `/${directory.replace('_', '')}/${slug}`
+ }
const frontmatter = {
...data,
@@ -67,20 +78,33 @@ export const getSortedPosts = (directory: string, limit?: number, tags?: any) =>
}
// Get Slugs
-export const getAllPostSlugs = (directory: string) => {
+export const getAllPostSlugs = (directory: Directories) => {
//Finding directory named "blog" from the current working directory of Node.
const postDirectory = path.join(process.cwd(), directory)
const fileNames = fs.readdirSync(postDirectory)
- return fileNames.map((filename) => {
+ const files = fileNames.map((filename) => {
+ const dates =
+ directory === '_blog'
+ ? getDatesFromFileName(filename)
+ : {
+ year: '2021',
+ month: '04',
+ day: '02',
+ }
+
return {
params: {
- slug: filename.replace('.mdx', '').substring(FILENAME_SUBSTRING),
- ...getDatesFromFileName(filename),
+ ...dates,
+ slug: filename
+ .replace('.mdx', '')
+ .substring(directory === '_blog' ? FILENAME_SUBSTRING : 0),
},
}
})
+
+ return files
}
// Get Post based on Slug
diff --git a/www/pages/blog/[year]/[month]/[day]/[slug].tsx b/www/pages/blog/[year]/[month]/[day]/[slug].tsx
index 289977cdd61..b2eeeeac618 100644
--- a/www/pages/blog/[year]/[month]/[day]/[slug].tsx
+++ b/www/pages/blog/[year]/[month]/[day]/[slug].tsx
@@ -44,6 +44,8 @@ export async function getStaticPaths() {
}
export async function getStaticProps({ params }: any) {
+ console.log('params', params)
+
const filePath = `${params.year}-${params.month}-${params.day}-${params.slug}`
const postContent = await getPostdata(filePath, '_blog')
const { data, content } = matter(postContent)
diff --git a/www/pages/case-studies/index.tsx b/www/pages/case-studies.tsx
similarity index 60%
rename from www/pages/case-studies/index.tsx
rename to www/pages/case-studies.tsx
index 97428c20828..9ee3204f554 100644
--- a/www/pages/case-studies/index.tsx
+++ b/www/pages/case-studies.tsx
@@ -17,8 +17,8 @@ import BlogHeader from '~/components/Blog/BlogHeader'
import ImageGrid from '~/components/ImageGrid'
export async function getStaticProps() {
- const allPostsData = getSortedPosts('_casestudies')
- const categories = getAllCategories('_casestudies')
+ const allPostsData = getSortedPosts('_case-studies')
+ const categories = getAllCategories('_case-studies')
const rss = generateRss(allPostsData)
// create a rss feed in public directory
@@ -51,14 +51,17 @@ function Blog(props: any) {
)
}, [category])
+ console.log(blogs)
+
const caseStudyThumbs = blogs.map((blog: PostTypes, idx: number) => {
return {
- image: '/image/asds',
- name: 'dsad ',
+ image: blog.logo,
+ name: blog.title,
+ link: blog.url,
}
})
- console.log(caseStudyThumbs)
+ // console.log('caseStudyThumbs', caseStudyThumbs)
return (
<>
@@ -72,36 +75,20 @@ function Blog(props: any) {
</Head>
<NextSeo title="Case studies" description="Latest customers using Supabase" />
<DefaultLayout>
- <BlogHeader title="Case studies" />
- <div className="bg-gray-50 dark:bg-dark-800 overflow-hidden py-12">
+ <div className="bg-white dark:bg-dark-800 overflow-hidden">
<div className="container mx-auto px-8 sm:px-16 xl:px-20 mt-32">
<div className="mx-auto max-w-7xl">
- <div className="grid grid-cols-12">
- <div className="col-span-12 lg:col-span-8">
- <Typography.Title level={2}>More posts from the team</Typography.Title>
- </div>
- <div className="col-span-12 lg:col-span-4 mt-4 lg:mt-0">
- <Space className="lg:justify-end" size={6}>
- <Typography.Text>Select a category</Typography.Text>
- <Select
- onChange={(e: React.ChangeEvent<HTMLSelectElement>) =>
- setCategory(e.target.value)
- }
- >
- <Select.Option key={'all'} value={'all'}>
- Show all
- </Select.Option>
- {props.categories.map((categoryId: string) => (
- <Select.Option key={categoryId} value={categoryId}>
- {categoryId}
- </Select.Option>
- ))}
- </Select>
- </Space>
- </div>
+ <div className="max-w-3xl mx-auto text-center">
+ <Typography.Title level={1}>Case studies</Typography.Title>
+ <Typography.Text>
+ <p className="text-xl">
+ Learn how teams behind everyone’s favorite products use Radix to save time,
+ boost quality, and set the bar for accessibility.
+ </p>
+ </Typography.Text>
</div>
<div className="mt-12 max-w-lg mx-auto grid lg:grid-cols-1 lg:max-w-none">
- <ImageGrid images={caseStudyThumbs} />
+ <ImageGrid images={caseStudyThumbs} lgCols={4} padding={6} className="h-32" />
</div>
</div>
</div>
diff --git a/www/pages/case-studies/[slug].module.css b/www/pages/case-studies/[slug].module.css
new file mode 100644
index 00000000000..66da7170e6c
--- /dev/null
+++ b/www/pages/case-studies/[slug].module.css
@@ -0,0 +1,46 @@
+.toc a {
+ text-decoration: none !important;
+ font-weight: 400 !important;
+}
+
+.toc > ul > li {
+ padding-left: 0 !important;
+}
+
+.toc li {
+ @apply text-sm !important;
+ padding-left: 1rem !important;
+}
+
+.toc ul > li:before {
+ content: '';
+ position: absolute;
+ background-color: none;
+ border-radius: 50%;
+ width: 0 !important;
+ height: 0 !important;
+ top: 0.6875em;
+ left: 0.25em;
+}
+
+.header:hover svg,
+.header svg:hover {
+ display: inline-block;
+}
+
+.article h1,
+.article h2,
+.article h3,
+.article h4,
+.article h5 {
+ font-weight: 500 !important;
+}
+
+.article {
+ @apply mb-16;
+}
+
+.article > div > pre {
+ padding: 0;
+ background: none;
+}
diff --git a/www/pages/case-studies/[slug].tsx b/www/pages/case-studies/[slug].tsx
new file mode 100644
index 00000000000..1f334466e6f
--- /dev/null
+++ b/www/pages/case-studies/[slug].tsx
@@ -0,0 +1,299 @@
+import {
+ Badge,
+ Card,
+ Divider,
+ IconFile,
+ Space,
+ Typography,
+ Button,
+ IconChevronRight,
+ IconChevronLeft,
+} from '@supabase/ui'
+import matter from 'gray-matter'
+import authors from 'lib/authors.json'
+import hydrate from 'next-mdx-remote/hydrate'
+import renderToString from 'next-mdx-remote/render-to-string'
+import { NextSeo } from 'next-seo'
+import Link from 'next/link'
+import { useRouter } from 'next/router'
+import React from 'react'
+import ReactMarkdown from 'react-markdown'
+import CodeBlock from '~/components/CodeBlock/CodeBlock'
+import CTABanner from '~/components/CTABanner'
+import DefaultLayout from '~/components/Layouts/Default'
+import Quote from '~/components/Quote'
+import ImageGrid from '~/components/ImageGrid'
+import { generateReadingTime } from '~/lib/helpers'
+import { getAllPostSlugs, getPostdata, getSortedPosts } from '~/lib/posts'
+import blogStyles from './[slug].module.css'
+import Image from 'next/image'
+
+// import all components used in blog articles here
+// for instance, if you use a button, you must add `Button` in the components object below.
+const components = {
+ CodeBlock,
+ Quote,
+ code: (props: any) => {
+ return <CodeBlock {...props} />
+ },
+ ImageGrid,
+}
+
+// plugins for next-mdx-remote
+const gfm = require('remark-gfm')
+const slug = require('rehype-slug')
+
+// table of contents extractor
+const toc = require('markdown-toc')
+
+export async function getStaticPaths() {
+ const paths = getAllPostSlugs('_case-studies')
+ console.log('paths', paths)
+ return {
+ paths,
+ fallback: false,
+ }
+}
+
+export async function getStaticProps({ params }: any) {
+ console.log('params', params)
+
+ const filePath = `${params.slug}`
+ const postContent = await getPostdata(filePath, '_case-studies')
+ const { data, content } = matter(postContent)
+
+ const mdxSource: any = await renderToString(content, {
+ components,
+ scope: data,
+ mdxOptions: {
+ remarkPlugins: [gfm],
+ rehypePlugins: [slug],
+ },
+ })
+
+ const relatedPosts = getSortedPosts('_case-studies', 5, mdxSource.scope.tags)
+
+ const allPosts = getSortedPosts('_case-studies')
+
+ const currentIndex = allPosts
+ .map(function (e) {
+ return e.slug
+ })
+ .indexOf(filePath)
+
+ const nextPost = allPosts[currentIndex + 1]
+ const prevPost = allPosts[currentIndex - 1]
+
+ const payload = {
+ props: {
+ prevPost: currentIndex === 0 ? null : prevPost ? prevPost : null,
+ nextPost: currentIndex === allPosts.length ? null : nextPost ? nextPost : null,
+ relatedPosts,
+ blog: {
+ slug: `${params.year}/${params.month}/${params.day}/${params.slug}`,
+ content: mdxSource,
+ ...data,
+ toc: toc(content, { maxdepth: data.toc_depth ? data.toc_depth : 2 }),
+ },
+ },
+ }
+
+ console.log(payload)
+ return payload
+}
+
+function BlogPostPage(props: any) {
+ // @ts-ignore
+ const author = props.blog.author ? authors[props.blog.author] : authors['supabase']
+ const content = hydrate(props.blog.content, { components })
+
+ const { basePath } = useRouter()
+
+ const NextCard = (props: any) => {
+ const { post, label, className } = props
+ return (
+ <Link href={`/blog/${post.url}`} as={`/blog/${post.url}`}>
+ <div className={className}>
+ <Card className="cursor-pointer" hoverable>
+ <Space direction="vertical">
+ <div>
+ <Typography.Text>{label}</Typography.Text>
+ </div>
+ <div>
+ <Typography.Title level={4}>{post.title}</Typography.Title>
+ <Typography.Text>{post.date}</Typography.Text>
+ </div>
+ <div>
+ {post.tags.map((tag: string) => {
+ return <Badge key={`categroy-badge-${tag}`}>{tag}</Badge>
+ })}
+ </div>
+ </Space>
+ </Card>
+ </div>
+ </Link>
+ )
+ }
+
+ return (
+ <>
+ <NextSeo
+ title={props.blog.title}
+ openGraph={{
+ title: props.blog.title,
+ description: props.blog.description,
+ url: `https://supabase.io/blog/${props.blog.slug}`,
+ type: 'article',
+ article: {
+ //
+ // to do: add expiration and modified dates
+ // https://github.com/garmeeh/next-seo#article
+ publishedTime: props.blog.date,
+ },
+ images: [
+ {
+ url: `https://supabase.io${basePath}/images/blog/${
+ props.blog.image ? props.blog.image : props.blog.thumb
+ }`,
+ },
+ ],
+ }}
+ />
+ <DefaultLayout>
+ <div
+ className="
+ bg-white dark:bg-dark-800
+ container px-8 sm:px-16 xl:px-20 mx-auto
+ py-16
+ "
+ >
+ <div className="grid grid-cols-12 gap-4">
+ <div className="col-span-12 lg:col-span-2">
+ <Typography.Text type="secondary">
+ <span className="hover:text-gray-900 dark:hover:text-white cursor-pointer flex items-center">
+ <IconChevronLeft />
+ Back
+ </span>
+ </Typography.Text>
+ </div>
+ <div className="col-span-12 lg:col-span-10">
+ {/* Title and description */}
+ <div className="mb-16">
+ <Typography.Text type="success">Case study</Typography.Text>
+ <Typography.Title>{props.blog.title}</Typography.Title>
+ </div>
+ {/* Quote can go here */}
+ <div className="grid grid-cols-12 gap-8">
+ {/* Content */}
+ <div className="col-span-12 lg:col-span-7 xl:col-span-6">
+ <article className={blogStyles['article']}>
+ <Typography>{content}</Typography>
+ </article>
+ </div>
+ {/* Sidebar */}
+ <div className="col-span-12 lg:col-span-5 xl:col-span-3 xl:col-start-8 space-y-8">
+ {/* Logo */}
+ <div className={`relative h-16 w-32`}>
+ <Image
+ layout="fill"
+ src={`${props.blog.logo}`}
+ alt={`${props.blog.title} logo`}
+ objectFit="scale-down"
+ // objectPosition="center"
+ className="
+ bg-no-repeat
+
+ dark:filter
+ dark:contrast-0
+ dark:brightness-200
+ "
+ />
+ </div>
+
+ <div className="flex flex-col space-y-2">
+ <Typography.Text type="secondary">About</Typography.Text>
+ <Typography.Text>{props.blog.about}</Typography.Text>
+ </div>
+ {props.blog.misc.map((x: any) => {
+ return (
+ <div className="flex flex-col space-y-2">
+ <Typography.Text type="secondary">{x.label}</Typography.Text>
+ <Typography.Text>{x.text}</Typography.Text>
+ </div>
+ )
+ })}
+ <div className="space-y-2">
+ {props.blog.stats.map((x: any) => {
+ return (
+ <div className="flex space-x-3">
+ <div className="h-8 w-0.5 bg-brand-600 mt-0.5"></div>
+ <div className="flex flex-col">
+ <Typography.Text>
+ <span className="text-3xl font-semibold leading-none">{x.stat}</span>
+ </Typography.Text>
+ <Typography.Text type="secondary">{x.label}</Typography.Text>
+ </div>
+ </div>
+ )
+ })}
+ </div>
+
+ <div className="flex flex-col space-y-2">
+ <Typography.Text type="secondary">Ready to get started?</Typography.Text>
+ <Button type="default" iconRight={<IconChevronRight />}>
+ Contact sales
+ </Button>
+ </div>
+
+ <div>
+ <Typography.Title className="mb-4" level={5}>
+ Related case stuides
+ </Typography.Title>
+
+ {props.relatedPosts.map((post: any) => (
+ <Link href={`/blog/${post.url}`} as={`/blog/${post.url}`}>
+ <div>
+ <Typography.Text className="cursor-pointer">
+ <Space>
+ <IconFile size={'small'} style={{ minWidth: '1.2rem' }} />
+ <span className="hover:text-gray-900 dark:hover:text-white">
+ {post.title}
+ </span>
+ </Space>
+ </Typography.Text>
+ <Divider light className="mt-2" />
+ </div>
+ </Link>
+ ))}
+
+ <Link href={`/case-studies`} as={`/case-studies`}>
+ <Typography.Text type="secondary">
+ <span className="hover:text-gray-900 dark:hover:text-white cursor-pointer">
+ View all case studies
+ </span>
+ </Typography.Text>
+ </Link>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div>{props.prevPost && <NextCard post={props.prevPost} label="Last post" />}</div>
+ <div>
+ {props.nextPost && (
+ <NextCard post={props.nextPost} label="Next post" className="text-right" />
+ )}
+ </div>
+ </div>
+ </div>
+ <CTABanner />
+ </DefaultLayout>
+ </>
+ )
+}
+
+// function BlogPostPage() {
+// return <h1>blog post</h1>
+// }
+
+export default BlogPostPage
diff --git a/www/public/case-studies-rss.xml b/www/public/case-studies-rss.xml
index c7db88e5ce1..924d63f25ae 100644
--- a/www/public/case-studies-rss.xml
+++ b/www/public/case-studies-rss.xml
@@ -5,15 +5,55 @@
<link>https://supabase.io</link>
<description>Latest news from Supabase</description>
<language>en</language>
- <lastBuildDate>Sun, 31 May 2020 16:00:00 GMT</lastBuildDate>
+ <lastBuildDate>Invalid Date</lastBuildDate>
<atom:link href="https://supabase.io/blog/rss.xml" rel="self" type="application/rss+xml"/>
<item>
- <guid>https://supabase.io/blog/verc/l./dx/</guid>
- <title>Supabase Alpha April 2020</title>
- <link>https://supabase.io/blog/verc/l./dx/</link>
+ <guid>https://supabase.io/blog//case-studies/xendit</guid>
+ <title>Xendit</title>
+ <link>https://supabase.io/blog//case-studies/xendit</link>
<description>Two months of building</description>
- <pubDate>Sun, 31 May 2020 16:00:00 GMT</pubDate>
+ <pubDate>Invalid Date</pubDate>
+</item>
+
+<item>
+ <guid>https://supabase.io/blog//case-studies/xendit copy</guid>
+ <title>Xendit</title>
+ <link>https://supabase.io/blog//case-studies/xendit copy</link>
+ <description>Two months of building</description>
+ <pubDate>Invalid Date</pubDate>
+</item>
+
+<item>
+ <guid>https://supabase.io/blog//case-studies/xendit copy 5</guid>
+ <title>Xendit</title>
+ <link>https://supabase.io/blog//case-studies/xendit copy 5</link>
+ <description>Two months of building</description>
+ <pubDate>Invalid Date</pubDate>
+</item>
+
+<item>
+ <guid>https://supabase.io/blog//case-studies/xendit copy 4</guid>
+ <title>Xendit</title>
+ <link>https://supabase.io/blog//case-studies/xendit copy 4</link>
+ <description>Two months of building</description>
+ <pubDate>Invalid Date</pubDate>
+</item>
+
+<item>
+ <guid>https://supabase.io/blog//case-studies/xendit copy 3</guid>
+ <title>Xendit</title>
+ <link>https://supabase.io/blog//case-studies/xendit copy 3</link>
+ <description>Two months of building</description>
+ <pubDate>Invalid Date</pubDate>
+</item>
+
+<item>
+ <guid>https://supabase.io/blog//case-studies/xendit copy 2</guid>
+ <title>Xendit</title>
+ <link>https://supabase.io/blog//case-studies/xendit copy 2</link>
+ <description>Two months of building</description>
+ <pubDate>Invalid Date</pubDate>
</item>
</channel>
diff --git a/www/public/images/case-studies/logos/netlify.png b/www/public/images/case-studies/logos/netlify.png
new file mode 100644
index 00000000000..1e6594bfe67
Binary files /dev/null and b/www/public/images/case-studies/logos/netlify.png differ
diff --git a/www/public/images/case-studies/logos/vercel.png b/www/public/images/case-studies/logos/vercel.png
new file mode 100644
index 00000000000..fb5d63e5ba6
Binary files /dev/null and b/www/public/images/case-studies/logos/vercel.png differ
diff --git a/www/public/images/case-studies/logos/xendit.png b/www/public/images/case-studies/logos/xendit.png
new file mode 100644
index 00000000000..1e79b75c831
Binary files /dev/null and b/www/public/images/case-studies/logos/xendit.png differ
diff --git a/www/types/post.ts b/www/types/post.ts
index 78dc49a16bd..be202e15d1c 100644
--- a/www/types/post.ts
+++ b/www/types/post.ts
@@ -16,6 +16,7 @@ type PostTypes = {
readingTime: string
url: string
tags: []
+ logo?: string
}
export default PostTypes