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

Refactor image handling and add support for saving images as base64 s… #9

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

NoamMuallem
Copy link

@NoamMuallem NoamMuallem commented Oct 21, 2024

As mentioned in the #8, to really use notion as a CMS, one needs to save the encoded images to the data-store.json to get all the benefits of a statically generated website.

Copy link

netlify bot commented Oct 21, 2024

👷 Deploy request for travel-tiger-x-daphne pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit cccfba2

@NoamMuallem NoamMuallem marked this pull request as draft October 21, 2024 05:57
@NoamMuallem
Copy link
Author

@NotWoods let me know if you have any preference as to where to place the new function, I am currently struggling with the typing a little bit...

@NoamMuallem NoamMuallem marked this pull request as ready for review October 25, 2024 03:38
@NotWoods
Copy link
Owner

Thank you for the PR! Reviews are going to be a bit slow right now as I'm on bereavement leave but I wanted to give some early feedback.

I like the idea of being able to store the images, but I'm interested in using Astro's image APIs rather than just converting to base64. Base64 is pretty inefficient and will hurt the end-user experience as it will pages take much longer to download.

Astro MDX uses a rehype parser to convert <img> tags into Astro Image components and I'd like to explore something similar here. It might even be possible to just import the existing rehype parser.

@NoamMuallem
Copy link
Author

NoamMuallem commented Oct 28, 2024

cool idea, like using the getImage function and store the optimized image?
About the parser, and the astro Image components, for me (and I think, for the package), it is out of scope because it effects the rendering of the stored content, and not the stored content itself...

@NotWoods
Copy link
Owner

Yeah, I'm thinking of the getImage function. Astro loaders do handle rendering so I don't feel that it's out of scope but you might be able to get the same effect working with Notion blocks.

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.

2 participants