Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add storyblok provider #133

Merged
merged 10 commits into from
Apr 6, 2021
Merged

feat: add storyblok provider #133

merged 10 commits into from
Apr 6, 2021

Conversation

flozero
Copy link
Contributor

@flozero flozero commented Dec 30, 2020

Storyblok provider based on storyblok image service documentation

https://www.storyblok.com/docs/image-service

Added storyblok provider
Added documentation

@pi0 pi0 changed the title feat: adding storyblok provider and update components to fit needs from storyblok filters feat: add storyblok provider Dec 30, 2020
@flozero flozero requested a review from pi0 January 5, 2021 00:50
@tillmon
Copy link

tillmon commented Jan 5, 2021

The image dimension should be included for aspect ratio calculation. See https://www.storyblok.com/faq/image-dimensions-assets-js

const url = src

const dimensions = {
    width: url.split('/')[5].split('x')[0],
    height: url.split('/')[5].split('x')[1]
}

return {
    url,
    getInfo: () => {
        return {
            width: dimensions.width,
            height: dimensions.height
        }
    }
}

@tillmon
Copy link

tillmon commented Jan 5, 2021

Also the docs should be updated.

@flozero
Copy link
Contributor Author

flozero commented Jan 6, 2021

Thank's for your feedback @tillmon. I am not sure to understand why I have to use it as the dimension of the image will be calculated by stoyblok automatically? Can you elaborate on why I should add it, please?

@tillmon
Copy link

tillmon commented Jan 6, 2021

I thought this is needed to calculate the space the image is occupying before it is loaded, but I am not sure.

@flozero
Copy link
Contributor Author

flozero commented Jan 6, 2021

I am pretty sure it's not useful.
User can define the default size or let storyblok calculate it. I don't think there is use case for it. But if people have definitely I will update it base on the need.

Base automatically changed from dev to main January 25, 2021 14:44
@hoektoe
Copy link

hoektoe commented Jan 30, 2021

Can't wait for this to use with storyblok and nuxtjs/image

@hoektoe
Copy link

hoektoe commented Feb 10, 2021

Is it just the merge conflict needing to be resolved or is there other issues related to this PR for it to get merged into master?

@flozero
Copy link
Contributor Author

flozero commented Mar 3, 2021

I am currently working on it @hoektoe. Thanks for your message :)

I need to validate with storyblok team first.

src/runtime/providers/storyblok.ts Outdated Show resolved Hide resolved
src/runtime/providers/storyblok.ts Outdated Show resolved Hide resolved
src/runtime/providers/storyblok.ts Outdated Show resolved Hide resolved
@hoektoe
Copy link

hoektoe commented Mar 12, 2021

I am currently working on it @hoektoe. Thanks for your message :)

I need to validate with storyblok team first.

Awesome, it's just a great integration. Enjoying both nuxtjs and storyblok together.

@flozero
Copy link
Contributor Author

flozero commented Apr 2, 2021

Then even after I asked I have no update on it from Storyblok. A bit disappointed :(

@pi0 pi0 merged commit cf04f1f into nuxt:main Apr 6, 2021
@pi0
Copy link
Member

pi0 commented Apr 6, 2021

Thanks @f3ltron <3

@flozero
Copy link
Contributor Author

flozero commented Apr 6, 2021

Thanks for your refactor :). I spoke with christian dev at storyblok they have validated it 👍🏼

@christianzoppi
Copy link

Hi everyone 😄 I double-checked all the features of the Storyblok Image Service and they are working perfectly. Thanks, @f3ltron! 🙌🏻

procrates pushed a commit to procrates/nuxt-image that referenced this pull request Feb 21, 2023
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants