github中托管的Jekyll博客:如何插入youtube嵌入?
我希望能够在Github托管的Jekyll网站中插入youtube视频github中托管的Jekyll博客:如何插入youtube嵌入?,youtube,jekyll,github-pages,Youtube,Jekyll,Github Pages,我希望能够在Github托管的Jekyll网站中插入youtube视频 有一个Jekyll,但它在github页面中不起作用 iframe也不起作用 <iframe width="420" src="hhtp://..." frameborder="0" allowfullscreen> </iframe> 有没有办法做到这一点,或者我们只能接受它?试试: <iframe width="560" height="315" src="https://www.
- 有一个Jekyll,但它在github页面中不起作用
- iframe也不起作用
<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页面中工作至关重要(而不安全的http
可能足以让它在本地工作)。它工作!是因为www.youtube.com/embed
url吗?是的。这是您可以在任何youtube视频页面上找到的嵌入代码。无效:拒绝显示https://www.youtube.com/embed/dQw4w9WgXcQ 在帧中,因为它将“X-frame-Options”设置为“sameorigin”
。据我所知,GitHub不允许使用外国来源的iFrame,而且似乎即使是本地运行的Jekyll也不允许使用这些iFrame。有什么解决办法吗?事实上,它是有效的。只需确保uri中存在/embed/
。