Skip to content

Instantly share code, notes, and snippets.

View ErisDS's full-sized avatar

Hannah Wolfe ErisDS

View GitHub Profile
ErisDS / http-store.js
Last active March 22, 2024 16:38
HTTP Store, Storage layer for Ghost 0.6.0 - passes images to a HTTP endpoint
var _ = require('lodash'),
fs = require('fs-extra'),
http = require('http'),
path = require('path'),
util = require('util'),
Promise = require('bluebird'),
options = {},
mimeTypes = {
ErisDS /
Last active December 20, 2023 18:05
Ghost Filter Query examples

Filter Queries - Example Use Cases

Here are a few example use cases, these use cases combine filter with other parameters to make useful API queries. The syntax for any of this may change between now, implementation, and release - they're meant as illustrative examples :)

Fetch 3 posts with tags which match 'photo' or 'video' and aren't the post with id 5.

api.posts.browse({filter: "tags:[photo, video] + id:-5", limit="3"});

GET /api/posts?filter=tags%3A%5Bphoto%2Cvideo%5D%2Bid%3A-5&limit=3

ErisDS /
Last active June 15, 2023 01:13
Bash Example of Ghost JWT Auth

Demo of generating a JWT and authenticating with Ghost's Admin API.


  • Save locally
  • With Ghost running on localhost:2368
  • sh {admin api key} to run


ErisDS /
Last active January 14, 2023 15:26
Deployment tools for Ghost themes

Gulp tools to deploy a Ghost theme

To set it up:

  • copy gulp-config.json.example to gulp-config.json
  • enter the blog admin url, no trailing slash, e.g.
  • grab the client secret for the frontend from the source of any page of the blog
  • enter the email address & password you use to login to the blog (must be administrator-level)

To deploy:

ErisDS /
Last active November 25, 2020 12:03
A Full and Comprehensive Style Test

Below is just about everything you'll need to style in the theme. Check the source code to see the many embedded elements within paragraphs.

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6
ErisDS / custom-reading-time.html
Created May 22, 2020 18:03
Examples of how to implement a custom reading time with the Ghost Content API + SDK
<script src=""></script>
<script src=""></script>
const api = new GhostContentAPI({
url: '',
key: '22444f78447824223cefc48062',
version: "v3"
ErisDS / stackPrinter.js
Last active April 24, 2020 15:12
Print an express middleware stack
module.exports = function stackPrinter(req, res, next) {
console.log('Printing Stack For', req.url);
function printItem(item, prefix) {
prefix = prefix || '';
if (item.route) {
console.log(prefix, 'Route', item.route.path);
} else if ( === '<anonymous>') {
console.log(prefix,, item.handle);
<script src=""></script>
const api = new GhostContentAPI({
url: '',
key: '22444f78447824223cefc48062',
version: "v3"
  • Most linux distros have a package manager, see the Node.js guide for details on installing node via various package managers or alternatively it is possible to download the .tar.gz archive from
  • Double check that you have Node and npm installed and that you have the right version, by typing node -v and npm -v into a terminal window and comparing with the blue box above.

Install Ghost

  1. Grab the latest version of Ghost from

    $ curl -L -o

  2. Unzip Ghost into the folder /var/www/ghost (recommended install location):

ErisDS / slimer.js
Created April 16, 2019 18:26
Extending sywac dynamically
#!/usr/bin/env node
const prettyCLI = require('@tryghost/pretty-cli');
const slimer = require('@tryghost/slimer');
const extensions = require('../extensions');
// Require internal commands