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 🙏

© 2025 – Pkg Stats / Ryan Hefner

hexo-imgur

v0.0.2

Published

populate post variables from imgur gallery

Downloads

6

Readme

hexo-imgur

Hexo filter and tag to populate post variables from imgur gallery. This plugin does not simply load an iframe, but allows you to format and style the gallery according to your hexo theme.

Deprecated

Please open an issue if you would like to take ownership.

installation

npm install hexo-filter-imgur --save

get your imgur client id

You'll need an imgur client id:

  • go to imgur [register an application][1] page.
  • Application Name: anything
  • Authorization type: anonymous usage
  • Authorization callback URL: blank
  • Application website: blank
  • email: your email
  • description: my hexo-filter-imgur api key

When I submitted this form (April 2016) there was some kind of server error.. and the form said I needed an auth callback url. I just submitted a second time and it worked, so IDK.

basic usage

First include your clientId in _config.yml.

imgur:
  clientId: e5230f612bb2a1d

Then insert the imgur tag in your post content:

{% imgur qUxdy3 %}

This will read the album with the key qUxdy3 from imgur, and render it inline, using templates/basic.ejs. Depending on what theme you're using, this may not look that great. Post an issue here on github if your theme is broken when you do this.

You can specify your own template if you like:

imgur:
  clientId: e5230f612bb2a1d
  galleryTemplate: themes/myAwesomeGallery.ejs

advanced usage

This method gives you much more control over how the gallery is rendered, but will require editing your theme

First configure your _config.yml, you need to map the imgur data (key name) to fields in your hexo post (value), the config below includes some common useful fields:

imgur:
  # clientId is a special case, not part of the map
  clientId: e5230f612bb2a1d
  # imgurKey: hexoKey
  title: title # default
  description: exerpt #default
  cover: cover # default
  imageLinks: photos # default
  datetime: datetime
  images: images

The photos field in hexo is commonly used by themes which expect it to contain a simple array of urls, the imageLinks key provides exactly that.

The images key contains an array of objects which look like this:

{
  "id": "CjmMMmM",
  "title": "Timber Beams",
  "description": "This is a timber beam",
  "datetime": "1 April 2016, 7:45 PM",
  "type": "image\/jpeg",
  "animated": false,
  "width": 3096,
  "height": 4128,
  "size": 1665684,
  "views": 853,
  "bandwidth": 1420828452,
  "vote": null,
  "favorite": false,
  "nsfw": null,
  "section": null,
  "account_url": null,
  "account_id": null,
  "comment_preview": null,
  "link": "http:\/\/i.imgur.com\/CjmMMmM.jpg"
}

You do not need to call the tag from your post as with "basic usage", just set imgurGalleryKey in your front matter, and then your template will have access to the fields you specified in your _config.yml.

After that the filter will be run automatically when you hexo generate

external references

[1]: https://api.imgur.com/oauth2/addclient imgur register