npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gatsby-remark-tumble-media

v1.2.3

Published

A gatsby plugin to do tumble blog style media embeds, like photosets, videos, and links.

Downloads

60

Readme

gatsby-remark-tumble-media

A gatsby plugin to do tumble blog style media embeds, like photosets, videos, and links.

Usage

This is designed to work alongside gatsby-remark-images. To use it, first install it:

npm install gatsby-remark-tumble-media

and then add this in your gatsby-config.js file, in the plugins section:

// ...
plugins: [
  {
    resolve: `gatsby-source-filesystem`,
    options: {
      name: `src`,
      path: `${__dirname}/src/`,
    },
  },
  {
    resolve: `gatsby-transformer-remark`,
    options: {
      plugins: [
        {
          resolve:`gatsby-remark-tumble-media`,
          options: {
            // optional, defaults to 700
            // should be the same as whatever remark-images
            // is using below.
            maxWidth: 700,
          }
        },
        `gatsby-remark-copy-linked-files`,
        {
          resolve: `gatsby-remark-images`,
          options: {
            // make this be the same as the remark-tumble-media
            // value above
            maxWidth: 700,
            // don't let remark-images make the images too big
            // which breaks the responsive design stuff.
            wrapperStyle: 'max-width:100% !important;'
          }
        },
      ],
    },
  },
  // ... other plugins...
]

Then, in your markdown posts, you can put things in the yaml frontmatter to create photosets and embeds.

Photo Sets

A photoset is a 2-d array of images. The first level of the array is the rows, and the next is the columns in that row. Images will be automatically scaled down to fit in the space allotted, with a 10px border between and around them.

Put the photos in the photos: field in your yaml. Then put the picture files themselves in the same folder as the markdown.

For example, this markdown post:

---
date: 2018-12-29
photos:
  - - four-in-a-row.jpg
    - cat.jpg Alt text goes here
  - - cat-on-its-own-row.jpg    Separate with any number of whitespace
  - - one-kitten.jpg
    - two-kittens.jpg
    - three-kitties.jpg
    - cat.png
  - - >-
      moving-cat.gif If you have a very long alt text to write, you
      can always take advantage of yaml's various features for folded
      text like this. Quote characters like '"' will be escaped as
      '&quo;' appropriately, but it should all be a single line in the
      end.  It's probably not a great idea to have this much alt text
      on an img tag, of course.  Just showing that the plugin will let
      you do so.
---
Aren't these such cute cats!?

would produce a page something like this:

picture of photoset result

If you only have one image in the photoset, then it won't have the white border. It'll just be full-size.

If the viewport shrinks too small to fit the rows and columns, then they'll responsive design CSS transform into a single column of full-width images.

Audio

To embed audio from a site like YouTube or wherever, just grab the embed code, and put it in a audio field in the yaml.

Example:

---
title: Portishead meets Wu Tang - Blue Flowers
audio: >-
  <iframe width="100%" height="300" scrolling="no"
  frameborder="no" allow="autoplay"
  src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/44509244&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true"></iframe>
---
Speaks for itself

Videos

Just like audio, but with video: instead of audio:.

---
video: >-
  <iframe width="560" height="315"
  src="https://www.youtube.com/embed/dQw4w9WgXcQ" frameborder="0"
  allow="accelerometer; autoplay; encrypted-media; gyroscope;
  picture-in-picture" allowfullscreen></iframe>
title: Great new hit single
---
Check out this new video I just found!

You can also do local files with a <video> tag. Here's an example.

YouTube Videos

To embed a YouTube video, put the YouTube url in the youtube field in the markdown frontmatter.

---
youtube: https://www.youtube.com/watch?v=dQw4w9WgXcQ
title: Great new hit single
---
Check out this new video I just found!

Vimeo Videos

To embed a Vimeo video, put the Vimeo url in the vimeo field in the markdown frontmatter.

---
vimeo: https://vimeo.com/232554578
title: Tar Wars
---
It is a period of civil war...