1.0.1 • Published 7 years ago
metalsmith-tweet-embed v1.0.1
metalsmith-tweet-embed

Converts Twitter status URLS to embedded Twitter statuses
Installation
With npm:
npm install metalsmith-tweet-embedWith yarn:
yarn add metalsmith-tweet-embedUsage
var metalsmith = require('metalsmith');
var tweetEmbed = require('metalsmith-tweet-embed');
metalsmith(__dirname)
.use(tweetEmbed())
.build();Options
You can limit which status links get converted by passing in pattern as a param.
var metalsmith = require('metalsmith');
var tweetEmbed = require('metalsmith-tweet-embed');
metalsmith(__dirname)
.use(tweetEmbed({ pattern: '**/*.md' }))
.build();You can also customize the options of the embed by using any options supported by the Twitter Status oEmbed API.
These options can be set directly from the plugin, or via frontmatter.
From Frontmatter
---
title: Look at this awesome page
twitter:
omit_script: false
align: center
---
This is my markdown content
https://twitter.com/BillGates/status/7957453193From Plugin
var metalsmith = require('metalsmith');
var tweetEmbed = require('metalsmith-tweet-embed');
metalsmith(__dirname)
.use(tweetEmbed({
options: {
omit_script: true,
align: 'center'
}
}))
.build();Any embed options set via frontmatter will overwrite options set from the plugin options.