vimeo.pug – Vimeo video iframes

View source code on Github

Embed videos

mixin vimeo-video(id)
  - if ("alt" in attributes)
    - alt = attributes.alt;
    - delete attributes.alt;
  - else
    - alt = true;
  iframe(src=`https://player.vimeo.com/video/${id}`
         frameborder="0"
         width="640"
         height="360"
         allowfullscreen)&attributes(attributes)
    - if (alt)
      | Your browser does not support iframes.
+vimeo-video(id)(width="640", height="360")

Insert a Vimeo video iframe given a identificator.

Arguments:
  • id (string / integer) – Video identificator, correspond to a number located at the end of a video url. For example, if a video has the url https://vimeo.com/96425312, the identificator is 96425312.

Usage

Input

+vimeo-video("152881306")(width="100%" height="315")

Output

<iframe width="100%" height="315" src="https://player.vimeo.com/video/152881306" frameborder="0" allowfullscreen></iframe>

Render