Creating a custom theme

·
By Ghost
·

Ghost comes with a beautiful default theme called Casper, which is designed to be a clean, readable publication layout and can be adapted for most purposes. However, Ghost can also be completely themed to suit your needs. Rather than just giving you a few basic settings which act as a poor proxy for code, we just let you write code.

There are a huge range of both free and premium pre-built themes which you can get from the Ghost Theme Marketplace, or you can create your own from scratch.

Anyone can write a completely custom Ghost theme with some solid knowledge of HTML and CSS

Ghost themes are written with a templating language called handlebars, which has a set of dynamic helpers to insert your data into template files. For example: {{author.name}} outputs the name of the current author.

The best way to learn how to write your own Ghost theme is to have a look at the source code for Casper, which is heavily commented and should give you a sense of how everything fits together.

  • default.hbs is the main template file, all contexts will load inside this file unless specifically told to use a different template.
  • post.hbs is the file used in the context of viewing a post.
  • index.hbs is the file used in the context of viewing the home page.
  • and so on

We've got full and extensive theme documentation which outlines every template file, context and helper that you can use.

If you want to chat with other people making Ghost themes to get any advice or help, there's also a themes section on our public Ghost forum.

Share

Articles

Apple Park Visitor Center
1 min read
The Visitor Center along Tantau Avenue, designed as an exclusive public gateway to Apple Park, it features an expansive roof terrace with stunning views of the main building that offers a unique glimpse into Apple Park. Nestled within a carefully planted olive grove, an exceptionally transparent envelope sits below a
Published in Design
Post title here
1 min read
A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine.I am so happy, my
Published in Getting Started
Theme styling guide
3 min read
All bearing night. Morning make. Creepeth behold saw. Created a own that. Hath green saw their that bearing a gathering shall face, likeness signs yielding life had god fly. Herb whales shall made upon whales blessed. Living their hath lesser brought were yielding called our moved firmament seasons first In.
Published in Getting Started
Welcome to Ghost
1 min read
Welcome, it's great to have you here. We know that first impressions are important, so we've populated your new site with some initial getting started posts that will help you get familiar with everything in no time.
Published in Getting Started
Writing posts with Ghost ✍️
1 min read
Getting started with the editor is simple, with familiar formatting options in a functional toolbar and the ability to add dynamic content seamlessly.
Published in Getting Started
Publishing options
2 min read
The Ghost editor has everything you need to fully optimise your content. This is where you can add tags and authors, feature a post, or turn a post into a page.
Published in Getting Started
Managing admin settings
2 min read
There are a couple of things to do next while you're getting set up: making your site private and inviting your team.
Published in Getting Started
Organising your content
2 min read
Ghost has a flexible organisational taxonomy called tags which can be used to configure your site structure using dynamic routing.
Published in Getting Started
Apps & integrations
1 min read
There are three primary ways to work with third-party services in Ghost: using Zapier, editing your theme, or using the Ghost API.
Published in Getting Started
Creating a custom theme
1 min read
Ghost comes with a beautiful default theme called Casper, which is designed to be a clean, readable publication layout and can be easily adapted for most purposes.
Published in Getting Started