youtube - Grav 标记如何在 frontmatter 中嵌入 youtube 视频?
问题描述
我计划使用frontmatter将youtube视频嵌入到grav网站中(该页面当前仅使用frontmatter,标记文件中没有条目):
rows:
-
title: XYZ
description: 'Something'
description_position: left
image: image.JPG
name: video
-
title: IJK
description: 'Something'
description_position: right
html: '<iframe width="560" height="315" src="https://www.youtube.com/embed/somevideo" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'
这不起作用。Grav 并没有说这不是有效的 frontmatter,但它也没有创建 iframe。有没有办法使用 html inline 在frontmatter中嵌入来自youtube的视频并且没有插件?
解决方案
您可以使用下面的代码
<//iframe style="position:center;bottom:0px;left:0px;height:100%;width:100%" src="https://www.youtube.com/embed/-5wpm-gesOY" frameborder="0" allowfullscreen></iframe>
(// 不使用)
好作品
推荐阅读
- gitlab - 如何在 gitlab .md 文件中创建可填充/可编辑的文本框?
- xslt-2.0 - XSLT 2.0:检查节点集中的字符串是否包含在另一个字符串中
- javascript - Html/jquery 多表单提交
- azure-data-factory - 在 Azure 数据工厂中,是否可以在不使用数据流的情况下控制大量输出文件的文件名?
- c# - 如何在 ActiveMQ Artemis 中创建非持久队列?
- flutter - 如何将数据从一个屏幕转移到另一个屏幕并用这些数据创建一些东西?
- python - 检查二叉树是否平衡
- docker - 如何将现有的 docker 存储库添加到 nexus
- ruby-on-rails - 在我的 React/Rails 项目中设置 Cloudinary 的问题
- c# - C# 使用 Invoked Class 中的循环更新 Invoking Class 中的信息