Comments (4)
you can try gatsby-remark-responsive-iframe
, it worked for me very well, although it generates some problems with my old posts (they have plenty of html code inside md files so there was some conflicts I didn't have the time to check).
an alternative - that's the one I'm using right now - is to insert a global css media query:
@media (max-width: 550px) {
.twitter-tweet {max-width: 300px !important;}
iframe { width: 300px; }
}
It is not elegant but it works well...
from gatsby-remark-oembed.
Just sketching an idea, it would awesome if the plugin took a container component in config options that wrapped embeds like Layout wraps pages like this:
<!-- page.md -->
`video: https://www.youtube.com/watch?v=k5veb0wZas0`
// gatsby-config.js
plugins: [
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
{
resolve: `@raae/gatsby-remark-oembed`,
options: {
container: require.resolve(
`${__dirname}/src/components/OEmbedContainer/index.js`
),
// usePrefix defaults to false
// usePrefix: true is the same as ["oembed"]
usePrefix: ['oembed', 'video'],
...
// components/OEmbedContainer/index.js
// Ideal
const OEmbedContainer = ({ OEmbed }) => ( <div><OEmbed/></div> );
// Because markdown is text
const OEmbedContainer = ({ embed }) => ( <div dangerouslySetInnerHTML={{ __html: embed }} /> );
Then we can roll our own responsive containers or whatever else.
from gatsby-remark-oembed.
Did this help @qipoy?
from gatsby-remark-oembed.
I like!
This fall I have time to give oembed some much-needed TLC and will look into this.
from gatsby-remark-oembed.
Related Issues (20)
- Setup mdx example site to Netlify HOT 1
- Fix format command in gatsby-remark-oembed package folder HOT 2
- Add Instagram hack to get around access token requirement? HOT 6
- Something is up with Twitch embeds HOT 8
- Move Instagram throw error when finding an instagram embed HOT 2
- New release HOT 1
- Add pull request template
- Add mdx support documentation HOT 1
- Logo HOT 1
- Improve test coverage for tranformsLinkNodeToOembedNode.js
- Improve performance in `getProviderEndpointForLinkUrl` HOT 1
- Move to GitHub actions form Travis? HOT 1
- Use without Gatsby HOT 11
- Add pluginOptionsSchema
- Create a new release HOT 8
- trim option should exclude <pre> HOT 2
- Twitter Embed - Missing blockquote.twitter-tweet HOT 2
- Transforms links that are list items HOT 2
- Transforms links that are image links HOT 1
- The automated release is failing 🚨
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-remark-oembed.