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

ghost-cloudinary-store

v3.3.0

Published

Cloudinary storage adapter for Ghost >= 1.x

Downloads

7

Readme

Build Status Code Climate Test Coverage Issue Count

IMPORTANT: You MUST be running Ghost 1.0.0 or later.

PLEASE create an issue if you have any problems.

Cloudinary has some "advanced configuration options" for Pro users and etc.. that this module does not currently handle. If you would like support for these options added, please create an issue or submit a PR!

To Use

Greenkeeper badge

NPM Installation Method

In Ghost's root directory

  1. Run npm install ghost-cloudinary-store (note the lack of --save)

  2. Install into the Ghost sources folder

2.1. Make the storage folder if it doesn't already exist mkdir versions/$GHOST_VERSION/core/server/adapters/storage/

2.2. Copy ghost-cloudinary-store from node_modules to versions/$GHOST_VERSION/core/server/adapters/storage

cp -r node_modules/ghost-cloudinary-store versions/$GHOST_VERSION/core/server/adapters/storage
  1. Install into the Ghost content folder

3.1. Make the storage folder if it doesn't already exist mkdir /$CONTENT_FOLDER/content/adapters/storage/

3.2. Copy ghost-cloudinary-store from node_modules to $CONTENT_FOLDER/content/adapters/storage/

cp -r node_modules/ghost-cloudinary-store $CONTENT_FOLDER/content/adapters/storage/
  1. Follow the instructions below for editing config.js

Git Installation Method

Note: The master branch reflects what is published on NPM

  1. Navigate to Ghost's base folder and create a directory called versions/$GHOST_VERSION/core/server/adapters/storage

  2. Navigate into this new storage directory and run git clone https://github.com/mmornati/ghost-cloudinary-store.git ghost-cloudinary-store

  3. Navigate into ghost-cloudinary-store and run npm install

  4. Follow the instructions below for editing config.js

Editing config.production.json

You have two options for configuring Ghost to work with your Cloudinary account:

  1. By using your Cloudinary credentials: cloud_name, api_key, and api_secret.
  2. By setting a CLOUDINARY_URL environment variable.

With Cloudinary credentials

In Ghost's config.production.json (the file where you set your URL, mail settings, etc..) as follows:

Note: These values can be obtained from your Cloudinary management console.

"storage": {
    "active": "ghost-cloudinary-store",
    "ghost-cloudinary-store": {
        "cloud_name": "yourCloudName",
        "api_key": "yourApiKey",
        "api_secret": "yourApiSecret"
    }
}

Further reading available here.

With a CLOUDINARY_URL environment variable

In Ghost's config.production.json (the file where you set your URL, mail settings, etc..) as follows:

"storage": {
    "active": "ghost-cloudinary-store"
}

Then set the CLOUDINARY_URL environment variable, available from your Cloudinary management console. It will look something like CLOUDINARY_URL=cloudinary://874837483274837:a676b67565c6767a6767d6767f676fe1@sample. Further reading available here. If you don't know what an environment variable is, read this.

Using Cloudinary API

You can find the documentation of what you can configure, directly on the Cloudinary website: http://cloudinary.com/documentation/image_transformations

"storage": {
    "active": "ghost-cloudinary-store",
    "ghost-cloudinary-store": {
        "cloud_name": "yourCloudName",
        "api_key": "yourApiKey",
        "api_secret": "yourApiSecret",
        "configuration": {
            "image": {
                "quality": "auto:good",
                "secure": "true"
            },
            "file": {
                "use_filename": "true",
                "unique_filename": "false",
                "phash": "true",
                "overwrite": "false",
                "invalidate": "true",
                "folder": "blog-images",
                "tags": ["blog"]
            }       
         }
    }
}

NOTE: The cloud_name, api_key and api_secret environment variables are not needed if you use the CLOUDINARY_URL environment variable.

A configuration.sample.jsonfile can be found into the project source to help you configure the plugin.

The file part into the configuration json is used to define the filename to use. By default, without any configuration, cloudinary will select a random name for the uploaded image. This can't allow you to block the same image to be uploaded plenty of times. Anytime you will upload the image it gets a new name. Configuring this part you can, for example, force Cloudinary to use the name you are providing (it is up to you to be sure about the unicity of the name).

You can find more information about and the list of possible parameters directly on the official Cloudinary documentation: http://cloudinary.com/documentation/image_upload_api_reference#upload