Skip to content
This repository has been archived by the owner on Aug 17, 2021. It is now read-only.
/ particle Public archive

Support various kinds of embeddable content in articles

License

Notifications You must be signed in to change notification settings

artsy/particle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

particle

Support various kinds of embeddable content in articles inspired by embed-video and enhanced for Artsy.

Supported content

Youtube Vimeo

Usage

Default options:

particle = require 'particle'
iframe = particle('https://www.youtube.com/watch?v=vq9pQi-SD1k')

Output:

<iframe src="//www.youtube.com/embed/vq9pQi-SD1k" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen"></iframe>

Query options:

particle = require 'particle'
iframe = particle 'https://www.youtube.com/watch?v=vq9pQi-SD1k', query:
  title: 0
  portrait: 0
  badge: 0

Output:

<iframe src="//www.youtube.com/embed/vq9pQi-SD1k?portrait=0&title=0&badge=0" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>

Class options:

particle = require 'particle'
iframe = particle 'https://www.youtube.com/watch?v=vq9pQi-SD1k', class: 'no-margin'

Output:

<iframe src="//www.youtube.com/embed/vq9pQi-SD1k" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen class="no-margin"></iframe>

Just get the video id and type

particle = require 'particle'
id = particle.getId('https://www.youtube.com/watch?v=vq9pQi-SD1k')
id -> vq9pQi-SD1k

About

Support various kinds of embeddable content in articles

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages