惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
H
Help Net Security
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
A
About on SuperTechFans
V
V2EX
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
宝玉的分享
宝玉的分享
aimingoo的专栏
aimingoo的专栏
F
Fortinet All Blogs
博客园 - 【当耐特】
Microsoft Security Blog
Microsoft Security Blog
Martin Fowler
Martin Fowler
I
InfoQ
Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
Engineering at Meta
Engineering at Meta
腾讯CDC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
U
Unit 42
The Cloudflare Blog
Y
Y Combinator Blog

Example blog

Ghost routing explained with routes.yaml examples — routes, collections & taxonomies Ghost redirects explained with practical redirects.yaml examples How to Serve JSON or XML Data in Ghost Ghost Custom Theme Settings How to add Google Fonts to Ghost Themes How to Configure Ghost with Mailgun Ghost Theme Structure & Organization How to Make Custom Templates in Ghost Themes How to Install Ghost CMS via Ghost-CLI How to Add Syntax Highlighting to Ghost The best Ghost CMS hosting platforms Ghost 6.0 — Social Web and Native Ghost Analytics Ghost CMS Social web beta, email 2FA and more author social links How to keep custom design settings when updating your Ghost theme How to use the public preview card in Ghost How to add members-specific sections in Ghost How to customize the default content CTA in Ghost How to build a custom homepage in Ghost An overview of Ghost editor cards and and how they work Ghost CMS News: One-time payments & collecting sales tax How to customize the private site access template in Ghost How to add custom fonts in Ghost themes Ghost CMS News: Additional payment methods & internal linking How to use Code Injection in Ghost How to set meta data of your custom routes & collections in Ghost Ghost CMS News: TK reminders, ActivityPub and improvements How to format dates and use the date helper in Ghost Ghost CMS internationalization, custom fonts & spam protection Understanding and optimizing post and page settings in Ghost CMS Trigger the Ghost Portal popup based on page scroll progress
How to Change Your Default Post Template in Ghost
Bright Themes · 2026-03-27 · via Example blog

In Ghost CMS, the post.hbs file is a handlebars template file that is used to display individual blog posts on the website and contains the code and markup that is used to structure and style the layout of individual blog posts. This usually includes elements such as the post title, author, publication date, feature image and the post content.

Changing the template

If you want to make changes to your default post template, you must edit the post.hbs file of your theme. Of course, if you just want to make stylistic changes, then those can be done from Code Injection without changing the theme files.

However, if you want to add some new elements or change the layout of the template, then you have to edit the file. For this you need to download the theme zip. Open the post.hbs file in an editor, make your changes and then reupload the changed theme.

Tip

Keep a copy of your original theme zip before making changes. It makes it much easier to revert if you introduce a template error.

Adding custom templates

At some point, you might want to add a new layout for some of your posts, maybe a limited series with a bespoke style, or some useful element, like a sidebar, etc. Ghost makes it easy to create custom templates for just such occasions.

The most important thing to notice when creating custom templates for ghost is that you have to prefix the template name by custom-. If you want to create a new custom template for your podcast episodes then you can create a new file with the following name custom-podcast-episode.hbs.

This file has to be created in the root folder of the theme.

Here's a detailed guide about creating custom template in Ghost.

Set another template as the default

Some themes come with multiple post template, we usually release theme with at least 4 templates you can choose from. In some cases you might want to change the default template with one of the other ones your theme has.

As mentioned before, the name of the custom template files starts with custom- so you can easily identify the files.

To change the default template follow the steps below:

  • download your theme files from the Ghost Admin
  • rename the post.hbs file to something like custom-old-default.hbs (or something more meaningful for your case)
  • rename the template you want to set as the default one to post.hbs
  • zip the theme directory and re-upload it in Ghost Admin

Your posts that have the 'Default' template selected now should use your new template.

Note

If you only want a different layout for some posts (not all of them), keep post.hbs as-is and create a new custom-*.hbs template instead. Then select that template per post from the Post Settings sidebar.