-
Notifications
You must be signed in to change notification settings - Fork 0
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
Social media embeds #107
Comments
Open
jbmoelker
added a commit
that referenced
this issue
Jan 22, 2024
# Changes - Adds an Embed Block that renders external content based on the block's OEmbed data. - Supports [~300 content providers](https://oembed.com/providers.json) (like Twitter, Flickr, YouTube, etc) using the [OEmbed](https://oembed.com/) protocol. - Renders a noscript embed version which is dynamically enhanced. - Lazy loads embed scripts and iframes to improve performance. - Provides a mechanism to define custom renderer per provider. - Adds specific implementations for Twitter, YouTube and Vimeo (the last two reusing the Video Embed Block). - If OEmbed data is unavailable, a link is displayed with the page title of the given URL. - Embed Block data is preloaded in the CMS using the [DatoCMS OEmbed Plugin](https://github.com/voorhoede/datocms-plugin-oembed/). # Associated issue Resolves #107 # How to test 1. Open preview link 2. Navigate to [page with embeds](https://feat-embed-block.head-start.pages.dev/en/embeds/) 3. Verify the different embeds are rendered correctly 4. Verify embeds are lazy loaded when scrolled into view 5. Verify embeds show a basic (non-enhanced) version when JS is disabled 6. Review Embed Block model in the CMS 7. Add an Embed Block to a page 8. Verify a preview is displayed and the embed data is set 9. Verify the new embed is rendered on the page # Checklist - [x] I have performed a self-review of my own code - [x] I have made sure that my PR is easy to review (not too big, includes comments) - [x] I have made updated relevant documentation files (in project README, docs/, etc) - ~~I have added a decision log entry if the change affects the architecture or changes a significant technology~~ - ~~I have notified a reviewer~~ <!-- Please strike through and check off all items that do not apply (rather than removing them) -->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
User story
As a content editor,
I want to embed content from social media,
so that I can easily enrich a web page with external content.
Possible solution
Use oembed, an open format designed to allow embedding content from a website into another page. OEmbed is supported by many providers (also available as npm package). An OEmbed endpoint returns HTML that can be embedded for a given resource URL (like a URL of a tweet on Twitter).
Example OEmbed usage by
astro-embed-twitter
:References
Questions?
The text was updated successfully, but these errors were encountered: