Skip to content

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

fix: blog authors

Isaiah Hamiltonc0938b3bd802
diff --git a/www/components/Blog/BlogListItem.tsx b/www/components/Blog/BlogListItem.tsx
index e7790bcded6..536463a9ffb 100644
--- a/www/components/Blog/BlogListItem.tsx
+++ b/www/components/Blog/BlogListItem.tsx
@@ -12,16 +12,14 @@ const BlogListItem = ({ post }: Props) => {
const authorArray = post.author && post.author.split(',')
const author = []
- if (post.type === 'blog' && post.author) {
- for (let i = 0; i < authorArray.length; i++) {
- author.push(
+ for (let i = 0; i < authorArray.length; i++) {
+ author.push(
+ // @ts-ignore
+ authors.find((authors: string) => {
// @ts-ignore
- authors.find((authors: string) => {
- // @ts-ignore
- return authors.author_id === authorArray[i]
- })
- )
- }
+ return authors.author_id === authorArray[i]
+ })
+ )
}
return (
@@ -48,9 +46,7 @@ const BlogListItem = ({ post }: Props) => {
</div>
<h3 className="max-w-sm text-xl text-scale-1200">{post.title}</h3>
- {post.type === 'blog' && post.date && (
- <p className="text-xs text-scale-1100">{post.date}</p>
- )}
+ {post.date && <p className="text-xs text-scale-1100">{post.date}</p>}
<p className="max-w-sm text-base text-scale-1100">{post.description}</p>
</div>
<div className="flex items-center -space-x-2">
diff --git a/www/pages/blog.tsx b/www/pages/blog.tsx
index f11fc03261a..d074ac6f560 100644
--- a/www/pages/blog.tsx
+++ b/www/pages/blog.tsx
@@ -3,6 +3,7 @@ import { useEffect, useState } from 'react'
import { useRouter } from 'next/router'
import Image from 'next/image'
+import Link from 'next/link'
import { NextSeo } from 'next-seo'
import { generateRss } from '~/lib/rss'
@@ -147,7 +148,7 @@ function FeaturedThumb(blog: PostTypes) {
return (
<div key={blog.slug} className="cursor-pointer w-full">
- <a href={`/blog/${blog.url}`}>
+ <Link href={`/blog/${blog.url}`}>
<a className="grid lg:grid-cols-2 gap-8 lg:gap-16">
<div className="relative overflow-auto w-full h-96 border rounded-lg">
<Image
@@ -168,6 +169,7 @@ function FeaturedThumb(blog: PostTypes) {
<p className="p text-xl">{blog.description}</p>
</div>
+ <div className="grid grid-rows-4 grid-flow-col gap-4 w-max">
{author.map((author: any) => {
return (
<div className="flex space-x-3 items-center">
@@ -188,9 +190,10 @@ function FeaturedThumb(blog: PostTypes) {
</div>
)
})}
+ </div>
</div>
</a>
- </a>
+ </Link>
</div>
)
}
diff --git a/www/pages/blog/[year]/[month]/[day]/[slug].tsx b/www/pages/blog/[year]/[month]/[day]/[slug].tsx
index bacfd356040..78c345f0546 100644
--- a/www/pages/blog/[year]/[month]/[day]/[slug].tsx
+++ b/www/pages/blog/[year]/[month]/[day]/[slug].tsx
@@ -104,10 +104,6 @@ function BlogPostPage(props: any) {
const { basePath } = useRouter()
- const copyLink = () => {
- navigator.clipboard.writeText(`https://supabase.com/blog/${props.blog.slug}`)
- }
-
const NextCard = (props: any) => {
const { post, label, className } = props
return (