• Stars
    star
    359
  • Rank 114,771 (Top 3 %)
  • Language
    CSS
  • License
    MIT License
  • Created over 5 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A development starter theme for Ghost

Ghost Starter Theme

A starter framework for Ghost themes! Click Use this template to create a copy of this repo for everything you need to get started developing a custom Ghost theme.

 

First time using a Ghost theme?

Ghost uses a simple templating language called Handlebars for its themes.

We've documented this starter theme pretty heavily so that it should be possible to work out what's going on just by reading the code and the comments. We also have a robust set of resources to help you build awesome custom themes:

  • The official theme documentation is the complete resource for everything you need to know about Ghost theme development
  • Tutorials offer a step-by-step guide to building the most common features in Ghost themes
  • The Ghost VS Code extension speeds up theme development and provides quick access to helpful info
  • All of Ghost's official themes are open source and are a great reference for learning how to create a theme

 

Starter theme features

🔁 Livereload by default. See changes instantly in the browser whenever you save a file.

🔎 Optimized for VS Code. Find the files you're looking for more easily.

🗃️ Write modern JavaScript. Use ESM out of the box to write more manageable Javascript.

🗜️ Assets optimized automatically. JavaScript and CSS are minified and transpiled by default.

👟 Fast compile times, powered by Rollup.

🦋 Write next-gen CSS for today's browsers with PostCSS. Add the CSS tools you love via rollup.config.js.

🚢 Ghost's GH Deploy Action included by default. Learn more how to deploy your theme automatically

 Extensible by design. Rollup's configuration structure makes it easy to add any number of plugins easily.

 

Theme structure

The main files are:

One neat trick is that you can also create custom one-off templates just by adding the slug of a page to a template file. For example:

  • page-about.hbs - Custom template for the /about/ page
  • tag-news.hbs - Custom template for /tag/news/ archive
  • author-jamie.hbs - Custom template for /author/jamie/ archive

 

Development guide

The Starter theme provides a first-class development experience out of the box.

 

Setup

To see realtime changes during development, symlink the Starter theme folder to the content/themes folder in your local Ghost install.

ln -s /path/to/starter /ghost/content/themes/starter

Restart Ghost and select the Starter theme from Settings.

From the theme's root directory, install the dependencies:

npm install

If Node isn't installed, follow the official Node installation guide.

 

Start development mode

From the Starter theme folder, start development mode:

npm run dev

Changes you make to your styles, scripts, and Handlebars files will show up automatically in the browser. CSS and Javascript will be compiled and output to the built folder.

Press ctrl + c in the terminal to exit development mode.

 

Build, zip, and test your theme

Compile your CSS and JavaScript assets for production with the following command:

npm run build

Create a zip archive:

npm run zip

Use gscan to test your theme for compatibility with Ghost:

npm run test

 

Copyright & License

Copyright (c) 2013-2023 Ghost Foundation - Released under the MIT license.

More Repositories

1

Ghost

Independent technology for modern publishing, memberships, subscriptions and newsletters.
JavaScript
44,370
star
2

node-sqlite3

SQLite3 bindings for Node.js
PLpgSQL
6,075
star
3

Casper

The default theme for Ghost
CSS
2,512
star
4

gatsby-starter-ghost

A starter template to build lightning fast websites with Ghost & Gatsby
JavaScript
1,042
star
5

Admin

Ghost's admin client
JavaScript
627
star
6

express-hbs

Express handlebars template engine with inheritance, partials, i18n and async helpers.
JavaScript
461
star
7

Ghost-CLI

CLI Tool for installing & updating Ghost
JavaScript
433
star
8

eleventy-starter-ghost

A starter template to build websites with Ghost & Eleventy
Nunjucks
335
star
9

action-deploy-theme

:octocat: Deploy your Ghost theme with Github Actions
JavaScript
335
star
10

Dawn

A minimal newsletter theme for Ghost
CSS
263
star
11

London

A free, open source theme for Ghost
Handlebars
258
star
12

Ghost-Android

🤖 Ghost for Android
Java
237
star
13

Ghost-Vagrant

Vagrant setup for developing Ghost
Puppet
226
star
14

Massively

A free, open source theme for Ghost
SCSS
216
star
15

Editorial

A free, open source theme for Ghost
SCSS
185
star
16

gatsby-source-ghost

Source plugin for pulling data into Gatsby.js from the Ghost Public API.
JavaScript
176
star
17

Lyra

A paid-members theme for Ghost
CSS
176
star
18

gatsby-plugin-advanced-sitemap

Advanced XML Sitemaps for Gatsby.js
JavaScript
149
star
19

Roon

The official Roon theme for Ghost
CSS
142
star
20

Koenig

Components of Ghost's Editor
JavaScript
116
star
21

Alto

A clean, minimalist theme featuring a light and dark mode for Ghost
Handlebars
114
star
22

docs

Ghost's official documentation
JavaScript
112
star
23

Ghost-App

Includes for Ghost Apps
JavaScript
111
star
24

SDK

Tools for working with Ghost's APIs
JavaScript
100
star
25

knex-migrator

DB migration tool for knex.js
JavaScript
98
star
26

Ghost-Config

Cross-platform meta data and configurations
JavaScript
82
star
27

Ease

A minimal documentation theme for Ghost
Handlebars
80
star
28

generator-ghost

Generate Ghost blogs and themes using Yeoman.
JavaScript
78
star
29

gscan

Ghost theme scanner - checks for errors and feature support
JavaScript
74
star
30

Edge

A visually aesthetic portfolio theme for Ghost
Handlebars
73
star
31

Edition

The newsletter theme for Ghost
JavaScript
72
star
32

Pico

A paid members publishing theme for Ghost
CSS
69
star
33

Wave

A podcast theme for Ghost
Handlebars
66
star
34

Themes

A monorepo for Ghost themes
Handlebars
61
star
35

Portal

Drop-in script to add membership features in a Ghost theme
JavaScript
56
star
36

Dope

A unique tag-based theme for Ghost
CSS
53
star
37

Ruby

A multi-column theme with a unique card layout for Ghost
Handlebars
44
star
38

Headline

A local news theme for Ghost
Handlebars
41
star
39

Journal

A newsletter theme for Ghost
Handlebars
41
star
40

GQL

Filter query language for working with Ghost's API
JavaScript
39
star
41

Source

The default theme for Ghost
CSS
38
star
42

nodecmsguide

Your guide to Node.js content management systems
JavaScript
37
star
43

Slimer-hubot

A bot who lives in IRC
CoffeeScript
36
star
44

wp-ghost-exporter

A WordPress plugin to export content to Ghost
PHP
30
star
45

migrate

JavaScript
27
star
46

Solo

A personal theme for Ghost
Handlebars
26
star
47

Members

JavaScript
24
star
48

Ghost-Editor

Ghost's Mobiledoc Editor
23
star
49

Argon

A simple publishing theme for Ghost
CSS
22
star
50

api-demos

Demo scripts showing how to use Ghost's Admin and Content APIs to accomplish common tasks.
JavaScript
22
star
51

gctools

Command line utilities for working with Ghost content
JavaScript
20
star
52

framework

A collection of handy components for building Node.js applications
JavaScript
20
star
53

bookshelf-relations

A bookshelf plugin which handles relationships.
JavaScript
18
star
54

Tribeca

A free theme for Ghost
CSS
16
star
55

Ignition

Basic configuration and tooling shared across applications
JavaScript
16
star
56

algolia

JavaScript
16
star
57

Utils

JavaScript
14
star
58

Ghost-Storage-Base

Base storage adapter for Ghost
JavaScript
13
star
59

slimer

Tools for working on Ghost & the surrounding ecosystem
JavaScript
11
star
60

vscode

TypeScript
11
star
61

roon-i18n

Roon Internationalization
Ruby
10
star
62

NQL-old

NQL Toolkit: Query data using the NQL Language
JavaScript
9
star
63

action-update-posts

GitHub action for making scheduled changes to posts (e.g. toggling featured)
JavaScript
9
star
64

passport-ghost

Passport adapter for logging in with Ghost.org
JavaScript
8
star
65

Bulletin

A newsletter theme for Ghost
Handlebars
7
star
66

eslint-plugin-ghost

Shared eslint configurations
JavaScript
7
star
67

comments-ui

Drop-in script for comments in Ghost
JavaScript
6
star
68

Digest

A newsletter theme for Ghost
Handlebars
6
star
69

static

Static remote assets for Ghost sites
6
star
70

action-ghost-release

🚢 GitHub Action to release Ghost
JavaScript
6
star
71

Deploy

Custom shipitjs plugin for deploying
JavaScript
6
star
72

mongo-knex

JavaScript
6
star
73

sodo-search

Drop-in script for search in Ghost
JavaScript
6
star
74

digitalocean-1-click

DigitalOcean 1-Click App
Shell
5
star
75

NQL

JavaScript
4
star
76

Zap

An ultra-minimal Ghost theme
CSS
4
star
77

Zapier

Ghost <-> Zapier Integration
JavaScript
4
star
78

slimer-dashboard

GitHub Dashboard built in Apollo
JavaScript
3
star
79

Taste

Handlebars
3
star
80

cropper

JavaScript
2
star
81

nameservers

2
star
82

bunyan-rotating-file-stream

Rotate bunyan logs based on time period and file-size threshold
JavaScript
2
star
83

Actions

GitHub Actions to power Ghost development
JavaScript
2
star
84

label-actions

Tools for managing Ghost's OSS repositories
JavaScript
1
star
85

.github

1
star
86

salt-formula-sensu

Salt formula for configuring Sensu.
1
star
87

Analytics

JavaScript
1
star
88

Core

JavaScript
1
star
89

action-trigger-metric

JavaScript
1
star
90

architecture-diagrams

Set of diagrams and docs explainig architecture of Ghost
1
star