nuxt-modules / cloudinary

Cloudinary Module for Nuxt
https://cloudinary.nuxtjs.org
MIT License
249 stars 34 forks source link

`CldOgImage.vue` component & `useCldOgImage.ts` composable #121

Closed Baroshem closed 1 year ago

Baroshem commented 1 year ago

Is your feature request related to a problem? Please describe.

https://next-cloudinary.spacejelly.dev/components/cldogimage/basic-usage https://next-cloudinary.spacejelly.dev/helpers/getcldogimageurl/basic-usage

Describe the solution you'd like

Describe alternatives you've considered

Additional context

colbyfayock commented 1 year ago

these are both basically identical to their non-OG counterparts, the only thing they do is set safe defaults

https://github.com/colbyfayock/next-cloudinary/blob/main/next-cloudinary/src/components/CldOgImage/CldOgImage.tsx#L20 https://github.com/colbyfayock/next-cloudinary/blob/main/next-cloudinary/src/helpers/getCldOgImageUrl.ts#L13

one thing i decided to add in my implementation of CldOgImage is a default Twitter Title for OG images, because without it, the Large Cards won't render on Twitter. so if someone doesnt provide a value, it's just an empty tag, which is better than not rendering

maybe the Nuxt API for the Head component has a better solution for dynamically grabbing the title for instance from the page