Ghost is an open source professional publishing platform based on the modern Node.js technology stack.
Ghost is an open source professional publishing platform based on the modern Node.js technology stack, designed for teams that need power, flexibility, and performance.
Ghost feature
Very fast |
✅ |
❌ |
✅ |
Reliable and safe |
✅ |
❌ |
✅ |
Great design |
✅ |
❌ |
✅ |
Modern technology |
✅ |
❌ |
✅ |
Open source |
✅ |
✅ |
❌ |
Own your brand + data |
✅ |
✅ |
❌ |
Using custom fields |
✅ |
✅ |
❌ |
Control your website design |
✅ |
✅ |
❌ |
No review |
✅ |
✅ |
❌ |
Built-in SEO control |
✅ |
❌ |
❌ |
Native REST API |
✅ |
❌ |
❌ |
Integrated SDK |
✅ |
❌ |
❌ |
Built-in membership and subscription |
✅ |
❌ |
❌ |
For any front-end |
✅ |
❌ |
❌ |
How to install Ghost
The quickest way to get started is to set up a site on Ghost(Pro). If you are running a self-hosted instance, we strongly recommend that you use an Ubuntu server with at least 1GB of memory to run Ghost.
Local installation Ghost
Ghost-CLI is a command line tool that helps you quickly and easily install and configure Ghost for use. The npm module can be installed on the local computer, and npm can also install yarn on the local computer, depending on your preference.
npm install ghost-cli@latest -g
After installation, you can always run ghost help to see a list of available commands.
In your terminal, cd goes to an empty directory and runs the installation command:
ghost install local
After installation, you will be able to access your new site http://localhost:2368 and
http://localhost:2368/ghost access Ghost Admin.
Start and stop
Ghost runs in a separate background process and keeps running until you stop it or restart your computer. So you may find these commands useful for using it:
- ghost stop Stop ghost
- ghost start ghost
- ghost log
- ghost ls Lists all running Ghost blogs
Verification using GScan
GScan is a tool to verify that the Ghost theme is compatible with the latest version of Ghost. Ghost automatically runs this tool when the theme is uploaded or activated. For development purposes, you can also run these checks yourself by installing it locally.
# Install gscan globally
npm install gscan -g
# Scan a theme directory for compatibility
gscan /path/to/ghost/content/themes/casper
# Scan a theme zip file for compatibility
gscan -z /path/to/downloads/theme.zip
Install Ghost from source code
First create a GitHub branch: First, you need to create a branch of the Ghost and ghost-admin repositories. Click the fork button on the top right and wait for a copy to be created on your personal GitHub account.
The next step is to configure the Git repository for local development: the main Ghost repository contains the full Ghost package, including admin clients and default themes, which will also be set up automatically
# First clone Ghost with submodules and make it your working dir
git clone --recurse-submodules git@github.com:TryGhost/Ghost & & cd Ghost
Rename
# Rename origin to upstream
git remote rename origin upstream
# Add your fork as an origin, editing in < YourUsername> !
git remote add origin git@github.com:< YourUsername> /Ghost.git
Because ghost-admin is a submodule repository for the Ghost main repository, you need to repeat the same steps to configure Git here as well.
# Switch to Ghost-Admin dir
cd core/admin
Update Ghost-Admin
# Quick check that everything is on latest
git checkout main & & git pull upstream main
# Then return to Ghost root directory
cd .. /.. /
Run setup and installation
# Only ever run this once
yarn setup
This setup task installs dependencies, initializes the database, sets up git hooks, initializes submodules, and runs the administrator’s first build.
Test
< Server test
Run the test using SQlite. To use MySQL, add NODE_ENV=testing-mysql
before the command
yarn test:unit
# Run unit tests
yarn test:acceptance
# Run acceptance tests
yarn test:regression
# Run regression tests
yarn test path/to/test.js
# Run a single test
yarn test test/unit/helpers
# Run a folder of tests
yarn test:all
# Run all tests
yarn lint
# Make sure your code doesn't suck
Client test
Client tests should always run inside the core/admin directory. Any time yarn dev runs client tests
http://localhost:4200/tests
ember test
# Run all tests in Chrome + Firefox
ember test --server
# Run all tests, leave results open, and watch for changes
ember test -f 'gh-my-component'
# Run tests where `describe()` or `it()` matches supplied argument
# Note: Case sensitive
ember test --launch=chrome
# Run all tests in Chrome only
ember test -s -f 'Acceptance: Settings - General' --launch=chrome
# Most useful test comment for continuous local development
# Targets specific test of area being worked on
# Only using Chrome to keep resource usage minimal
Troubleshooting
ERROR: (EADDRINUSE) Failed to start Ghost
This error indicates that Ghost is already running and you need to stop it.
ERROR: ENOENT
This error means that the mentioned file does not exist.
ERROR Error: Module not found
Installation not complete. Run yarn:fix.
Error: Module not found”
./build/default/DTraceProviderBindings”
You switched node versions. Run yarn:fix.
ENOENT: no such file or directory, showing ‘path/to/favicon.ico’
at error (local)
Your administrative client has not yet been built. Run yarn dev.
TypeError: Cannot read property ‘tagName’ of undefined
You cannot run yarn dev at the same time as ember test. Wait for the test to complete before continuing, and wait for the “build successful” message before loading the administrator.
Topic development
The
Ghost theme uses the Handlebars template language, which uses helper programs to establish a strong separation between templates (HTML) and any JavaScript logic. This allows themes to be very fast, have dynamic client applications, and publish content on the server side as static HTML sent to the browser.
Ghost also uses an add-on library called express-hbs that adds some additional functionality to Handlebars, such as layout and localisation.
If you’ve built themes for other popular platforms before, it’s pretty easy to use the Ghost theme layer. This document gives you the tools you need to create static HTML and CSS for your theme, using Handlebars expressions when you need to render dynamic data.
To use GScan as a command line tool, install the gscannpm package globally:
# Install the npm package
npm install -g gscan
# Use gscan < file path> anywhere to run gscan against a folder
gscan /path/to/ghost/content/themes/casper
# Run gscan on a zip file
gscan -z /path/to/download/theme.zip
Topic recommendation

—END—
Open Source protocol: MIT license