我希望能够在Github托管的Jekyll站点中插入YouTube视频。
There is a Jekyll plugin for embedding youtube videos but it does not work in github pages.
An iframe does not work either.
<iframe width="420" src="hhtp://..." frameborder="0" allowfullscreen> </iframe>
我希望能够在Github托管的Jekyll站点中插入YouTube视频。
There is a Jekyll plugin for embedding youtube videos but it does not work in github pages.
An iframe does not work either.
<iframe width="420" src="hhtp://..." frameborder="0" allowfullscreen> </iframe>
尝试:
<iframe width="560" height="315" src="https://www.youtube.com/embed/dQw4w9WgXcQ" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
@David Jacquel的回复中还有一个小细节需要补充:
https
的安全性对于在Github Pages中使用至关重要(而不安全的http
在本地工作时可能足够)。
可以直接从YouTube获取HTML代码。
只需按以下步骤:
www.youtube.com/embed
的URL吗? - alberto拒绝显示https://www.youtube.com/embed/dQw4w9WgXcQ在框架中,因为它将“X-Frame-Options”设置为“sameorigin”。
据我所知,GitHub不允许外来的iframes,而即使是本地运行的Jekyll也不允许这些内容。有什么解决方法吗? - Ivan/embed/
。 - Maxim Zhukov