youtubeembedgravyaml-front-matter

Grav markup how to embed youtube video in frontmatter?


I was planning to do something like the following to embed a youtube video into a grav website using frontmatter (the page is currently using only only frontmatter with no entries in the markup file):

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>'

This does not work. Grav does not say that this isn't valid frontmatter but it just doesn't create the iframe either. Is there a way to embed video from youtube using html inline in the frontmatter and without plugins?


Solution

  • They also have a dedicated youtube plugin (written by the grav developers) to better integrate into the markdown and frontmatter: https://github.com/getgrav/grav-plugin-youtube