Skip to content

Instantly share code, notes, and snippets.

Avatar

Hannah Wolfe ErisDS

View GitHub Profile
@ErisDS
ErisDS / custom-reading-time.html
Created May 22, 2020
Examples of how to implement a custom reading time with the Ghost Content API + SDK
View custom-reading-time.html
<html>
<head>
<script src="https://unpkg.com/@tryghost/content-api@latest/umd/content-api.min.js"></script>
<script src="https://unpkg.com/@tryghost/helpers@1.1.27/umd/helpers.min.js"></script>
<script>
const api = new GhostContentAPI({
url: 'https://demo.ghost.io',
key: '22444f78447824223cefc48062',
version: "v3"
View read-post.html
<html>
<head>
<script src="https://unpkg.com/@tryghost/content-api@latest/umd/content-api.min.js"></script>
<script>
const api = new GhostContentAPI({
url: 'https://demo.ghost.io',
key: '22444f78447824223cefc48062',
version: "v3"
});
View Install-Ghost-Linux-Legacy.md
  • 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 http://nodejs.org
  • 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 Ghost.org:

    $ curl -L https://github.com/TryGhost/Ghost/releases/download/0.11.12/Ghost-0.11.12.zip -o ghost.zip

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

@ErisDS
ErisDS / slimer.js
Created Apr 16, 2019
Extending sywac dynamically
View slimer.js
#!/usr/bin/env node
const prettyCLI = require('@tryghost/pretty-cli');
const slimer = require('@tryghost/slimer');
const extensions = require('../extensions');
// Require internal commands
prettyCLI.commandDirectory('../commands');
slimer
.loadCommands()
@ErisDS
ErisDS / README.md
Created Mar 7, 2019
Ruby Example of Ghost JWT Auth
View README.md

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

Usage:

  • Save ghost-auth.rb locally
  • gem install httparty jwt first
  • With Ghost running on localhost:2368
  • ruby ghost-auth.rb {admin api key} to run

Gotchas:

@ErisDS
ErisDS / README.md
Last active Mar 7, 2019
Bash Example of Ghost JWT Auth
View README.md

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

Usage:

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

Gotchas:

@ErisDS
ErisDS / README.md
Last active Mar 29, 2021
Deployment tools for Ghost themes
View README.md

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. https://myblog.ghost.io
  • 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
ErisDS / changelog.md
Last active Jul 26, 2017 — forked from kevinansfield/changelog.md
Full 1.0.0 Changelog
View changelog.md

Highlights

  • [New] A brand new editor based on Mobiledoc, using SimpleMDE & Markdown-it to recreate full markdown support
  • [New] Casper 2.0 - an overhaul that makes use of all of Ghost's best theme features
  • [New] Improved default posts, explaning more features and a welcome tour to guide users around
  • [New] Nightshift mode light text on a dark background for editing at night, available in labs
  • [New] Config with nconf, logging with bunyan, and debug output using debug.
  • [Improved] Publish menu which brings scheduling front and centre, instead of it being an after thought
  • [Improved] Simplified content screen with filtering makes it easier to find
  • [Improved] The importer has had a complete overhaul, is now more robust and outputs much, much better error & warning messages when things do go awry
@ErisDS
ErisDS / README.md
Last active Nov 5, 2017
Ansible tips for Ghost-Cli TODO: make this a proper repo
View README.md

This assumes that you have already installed:

  • mariadb/mysql (no example provided)
  • node v6 (see node-install.yml)
  • ghost-cli latest (see ghost-cli-install.yml)
  • nginx (see nginx-install-config.yml)

After that, running install-ghost.yml will:

  • create you a db user (ghost cli may take this over in future)
@ErisDS
ErisDS / event_types.json
Created Jun 7, 2017
All Chargebee v2 Events as a JSON object.
View event_types.json
[
{
"name": "plan_created",
"trigger": "Triggered when a plan is created",
"resources": ["plan"]
},
{
"name": "plan_updated",
"trigger": "Triggered when a plan is changed",
"resources": ["plan"]