railwayapp / blog

77 stars 28 forks source link

README: Image and FeaturedImage should be of type url in notion. #46

Open jmunozz opened 8 months ago

jmunozz commented 8 months ago

The readme says Image and FeaturedImage should be of type text but the code seems to say otherwise.

export const FeaturedPostItem: React.FC<{ post: PostProps }> = ({ post }) => {
  const formattedDate = useMemo(
    () =>
      dayjs(new Date(post.properties.Date.date.start)).format("MMM D, YYYY"),
    [post.properties.Date.date.start]
  );

  const author = post.properties.Authors.people[0];
  const category = post.properties.Category.select?.name;
  const featuredImage = post.properties.FeaturedImage.url;

Once I have changed type of FeaturedImage from text to url in my notion db, it started to display on my blog. I suggest just update the README.md