GitHub - heiseonline/embetty: ? Embetty displays remote content like tweets or Y...
source link: https://github.com/heiseonline/embetty
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
README.md
embetty ·
Embetty displays remote content like tweets or YouTube videos without compromising your privacy.
Quick Start
- Setup your embetty-server.
- Include the embetty lib into your HTML document.
- Insert an embed by using a custom tag (see embeds section below).
Example:
<!DOCTYPE html> <html lang="en"> <head> <meta data-embetty-server="/path/to/embetty-server"> <script async src="embetty.js"></script> </head> <body> <embetty-tweet status="950371792874557440"></embetty-tweet> </body> </html>
Documentation
Configure the Embetty server
Embetty needs a server component that you need to run on your infrastructure. Configure the server URL for embetty using a <meta data-embetty-server>
tag:
<head> <meta data-embetty-server="/path/to/embetty-server"> </head>
Including embetty.js
There are three options.
- Download an Embetty archive from the releases page. Make
embetty.js
available on your site. - Use Embetty in your npm project:
yarn add @heise/embetty
ornpm install @heise/embetty --save
. Then import embetty into your main script (i.e.import '@heise/embetty'
). - Clone this repository and build
./dist/embetty.js
:$ git clone https://github.com/heiseonline/embetty $ cd embetty $ yarn $ yarn build
Supported embed types
Currently, tweets and various video platforms are supported.
Tweet
Use the status
attribute to embed a tweet with its tweet ID. Example:
<embetty-tweet status="950371792874557440"></embetty-tweet>
Video
Use the type
attribute with a value of facebook
, vimeo
or youtube
. Set the video-id
attribute to the video ID.
<embetty-video type="youtube" video-id="3L4fHrIJ3A4"></embetty-video> <embetty-video type="vimeo" video-id="223099532"></embetty-video> <embetty-video type="facebook" video-id="10156049485672318"></embetty-video>
License
Embetty is MIT licensed.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK