Skip to content

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

Merge branch 'master' into chore/blog-update

Jonathan Summers-Muir184c0f4f2413
diff --cc www/pages/blog.tsx
index e7f5ea9a01c,04944328269..147dc76f28e
--- a/www/pages/blog.tsx
+++ b/www/pages/blog.tsx
@@@ -35,17 -35,13 +34,17 @@@ function Blog(props: any)
const [category, setCategory] = useState('all')
const [blogs, setBlogs] = useState(props.blogs)
- const { basePath } = useRouter()
+ const router = useRouter()
useEffect(() => {
- // Update the document title using the browser API
+ // contruct an array of blog posts
+ // not inluding the first blog post
+ const shiftedBlogs = [...props.blogs]
+ shiftedBlogs.shift()
+
setBlogs(
category === 'all'
- ? props.blogs
+ ? shiftedBlogs
: props.blogs.filter((post: any) => {
const found = post.tags.includes(category)
return found
@@@ -53,60 -49,92 +52,74 @@@
)
}, [category])
+ useEffect(() => {
+ return props.categories.unshift('all')
+ }, [])
+
+ // append 'all' category
+ // const categories = props.categories.push('all')
+ const meta_title = 'Supabase Blog: Open Source Firebase alternative Blog'
+ const meta_description = 'Get all your Supabase News on the Supabase blog.'
return (
<>
- <Head>
- <link
- rel="alternate"
- type="application/rss+xml"
- title="RSS feed for blog posts"
- href={`${basePath}/rss.xml`}
- />
- </Head>
- <NextSeo title="Blog" description="Latest news from the Supabase team." />
+ <NextSeo
+ title={meta_title}
+ description={meta_description}
+ openGraph={{
+ title: meta_title,
+ description: meta_description,
+ url: `https://supabase.com/${router.pathname}`,
+ images: [
+ {
+ url: `https://supabase.com/images/og/og-image.jpg`,
+ },
+ ],
+ }}
+ additionalLinkTags={[
+ {
+ rel: 'alternate',
+ type: 'application/rss+xml',
+ href: `https://supabase.com/rss.xml`,
+ },
+ ]}
+ />
<DefaultLayout>
- <BlogHeader title="Blog" />
- <div className="bg-gray-50 dark:bg-dark-800 overflow-hidden py-12">
+ <div className="bg-white dark:bg-dark-800 overflow-hidden py-12">
<div className="container mx-auto px-8 sm:px-16 xl:px-20 mt-16">
- <div className="mx-auto max-w-7xl">
- <Typography.Title level={2}>Latest posts</Typography.Title>
- <div className="mt-5 max-w-lg mx-auto grid gap-16 lg:grid-cols-2 lg:max-w-none">
- {props.blogs.slice(0, 2).map((blog: any, idx: any) => {
- return FeaturedThumb(blog)
- })}
- </div>
+ <div className="mx-auto ">
+ {props.blogs.slice(0, 1).map((blog: any, idx: any) => {
+ return FeaturedThumb(blog)
+ })}
</div>
</div>
- <div className="container mx-auto px-8 sm:px-16 xl:px-20 mt-32">
- <div className="mx-auto max-w-7xl">
+ </div>
+
+ <div className="border-t dark:border-dark">
+ <div className="container mx-auto px-8 sm:px-16 xl:px-20 mt-16">
+ <div className="mx-auto ">
<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>
- <Dropdown
- style={{
- height: '50vh',
- overflow: 'auto',
- }}
- overlay={[
- <Dropdown.RadioGroup value={category} onChange={setCategory}>
- <Dropdown.Radio key={'all'} value="all">
- Show all
- </Dropdown.Radio>
- {props.categories.map((categoryId: string) => (
- <Dropdown.Radio key={categoryId} value={categoryId}>
- {categoryId}
- </Dropdown.Radio>
- ))}
- </Dropdown.RadioGroup>,
- ]}
- >
- <Button
- type="outline"
- className="sbui-select--medium"
- iconRight={<IconChevronDown />}
- >
- {category === 'all' ? 'Show all' : category}
- </Button>
- </Dropdown>
- </Space>
+ <div className="col-span-12 lg:col-span-12">
+ <Tabs scrollable size="medium" onChange={setCategory} defaultActiveId={'all'}>
+ {props.categories.map((categoryId: string) => (
+ <Tabs.Panel id={categoryId} label={categoryId}>
+ {/* <p>{categoryId}</p> */}
+ <></>
+ </Tabs.Panel>
+ ))}
+ </Tabs>
</div>
</div>
- <div className="mt-12 max-w-lg mx-auto grid lg:grid-cols-1 lg:max-w-none">
- {/* <ul> */}
- {blogs.map((blog: PostTypes, idx: number) => (
- <BlogListItem blog={blog} key={idx} />
- ))}
- {/* </ul> */}
- </div>{' '}
</div>
- </div>
+
+ <ol className="grid grid-cols-12 py-16 gap-8 lg:gap-16">
+ {blogs.map((blog: PostTypes, idx: number) => (
+ <div className="col-span-12 md:col-span-12 lg:col-span-6 xl:col-span-4 mb-16">
+ <BlogListItem blog={blog} key={idx} />
+ </div>
+ ))}
+ </ol>
+ </div>{' '}
</div>
</DefaultLayout>
</>