ishan0102 / engblogs

learn from your favorite tech companies
https://engblogs.dev
MIT License
162 stars 16 forks source link

Add logo feature for blog poasts #41

Closed iturner72 closed 10 months ago

iturner72 commented 11 months ago

New Feature: Blog Post Logos

Description

This feature allows the addition of logos to blog posts. It utilizes Supabase storage buckets for logo management and requires new table relationships to link logos to their respective posts.

Supabase Configuration

The foreign link looks like this when I hover over the company column in the posts table:

company -> public.links.company

Let me know if this feature is worth, I think it looks nice on the sister brypto site I've created. If the instructions are unclear, or the implementation sucks, please let me know :)

logo_feature

vercel[bot] commented 11 months ago

Someone is attempting to deploy a commit to a Personal Account owned by @ishan0102 on Vercel.

@ishan0102 first needs to authorize it.

vercel[bot] commented 11 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
engblogs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 3, 2023 3:57pm
ishan0102 commented 11 months ago

Love this idea, I'll implement this weekend

ishan0102 commented 10 months ago

Do you know how to convert my already existing company column in the posts table to a foreign key without breaking stuff?

iturner72 commented 10 months ago

Do you know how to convert my already existing company column in the posts table to a foreign key without breaking stuff?

Yes, I should've added some more photos. I did everything in the Supabase UI.

  1. Head to posts table, click dropdown arrow next to company column title.
  2. Add new foregin key relation

Below are the screenshots that show the fields to edit and how it should look afterwards:

step2 step1 step3

ishan0102 commented 10 months ago
image

Cool just need to fix this error and that should work, think I just need to add some constraint

looks like links.company needs to be unique lemme try that

iturner72 commented 10 months ago

image Cool just need to fix this error and that should work, think I just need to add some constraint looks like links.company needs to be unique lemme try that

Did you create

iturner72 commented 10 months ago

oops, Meant to reply with:

Did you create the new column to store logo urls in the links table?

ishan0102 commented 10 months ago

Yep created that column, will get these db changes in and then update frontend with your changes later

iturner72 commented 10 months ago

Awesome! I used all kinds of image formats for the logos .png, .jpeg, .ico to see if they worked and those all do just FYI

ishan0102 commented 10 months ago

Great that's good to know, I'll try to find good logo assets. also supabase is insanely slow rn

iturner72 commented 10 months ago

yea, I noticed they had a banner last night saying they were fixing some bug. It was gone today, but perhaps related

ishan0102 commented 10 months ago

Sweet it worked!

iturner72 commented 10 months ago

lessgo :)