Convert twitter status links to twitter embeds in metalsmith
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src fix tests; add npm deploy Nov 11, 2018
test fix tests; add npm deploy Nov 11, 2018
.babelrc node >= 8 Nov 14, 2018
.editorconfig initial commit Nov 11, 2018
.eslintignore initial commit Nov 11, 2018
.eslintrc initial commit Nov 11, 2018
.gitignore initial commit Nov 11, 2018
.travis.yml publish only on node Nov 14, 2018
license initial commit Nov 11, 2018
package-lock.json v1.0.1 Nov 30, 2018
package.json v1.0.1 Nov 30, 2018
readme.md update readme with settigns Nov 11, 2018
renovate.json Update renovate.json Nov 11, 2018
rollup.config.js import package for dependencies Nov 11, 2018

readme.md

metalsmith-tweet-embed Build Status Coverage Status npm

Converts Twitter status URLS to embedded Twitter statuses

Installation

With npm:

npm install metalsmith-tweet-embed

With yarn:

yarn add metalsmith-tweet-embed

Usage

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/7957453193

From 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.

License

MIT