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

推荐订阅源

Google DeepMind News
Google DeepMind News
B
Blog RSS Feed
量子位
aimingoo的专栏
aimingoo的专栏
V
Visual Studio Blog
Y
Y Combinator Blog
Vercel News
Vercel News
云风的 BLOG
云风的 BLOG
宝玉的分享
宝玉的分享
Engineering at Meta
Engineering at Meta
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
GbyAI
GbyAI
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
Stack Overflow Blog
Stack Overflow Blog
大猫的无限游戏
大猫的无限游戏
Microsoft Security Blog
Microsoft Security Blog
B
Blog
Last Week in AI
Last Week in AI
有赞技术团队
有赞技术团队
博客园 - 聂微东
腾讯CDC
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
J
Java Code Geeks

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 How to Change Your Default Post Template in Ghost 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
Ghost Custom Theme Settings
Bright Themes · 2026-03-27 · via Example blog

Ghost custom theme settings were introduced in Ghost 4.20.0 and have become a standard way to expose safe, self-serve customization options in the Admin UI.

Note

The UI labels and grouping can vary slightly across Ghost versions, but the theme-side configuration format stays the same.

Custom settings overview

Ghost provides five types of custom theme settings:

  • select - renders a select input with several options that can be defined ( options and default is required)
  • boolean - renders a checkbox toggle (default is required and can be true or false)
  • color - renders a color picker (default is required and it has to be a valid hexadecimal string)
  • image - renders an image uploader (default is not allowed)
  • text - renders a text input (default is optional)

These have to be defined in the package.json file, more specifically under the config key, where you can also find the posts_per_page and image_sizes defined. You have to create a new key custom and define your custom property.

For example:

{
  "config": {
    "custom": {
      "hero_headline": {
        "type": "text",
        "group": "homepage"
      }
    }
  }
}

In the example above the "hero_headline" will be displayed in the admin area as an input field and the site owner can add any text. To use this new property in Handlebars templates you can reference it like this:

{{@custom.hero_headline}}

Caution

Important to note that the "type" must be defined and must be valid (one of the five settings types) Also the setting keys must be lowercase without any special character and in snake case

Theme settings can be grouped, there are 3 categories:

  • Site-wide - for settings that apply to all pages
  • Homepage - for settings that apply to the homepage
  • Post - for settings that apply to posts

Note

By default, all settings appear in Ghost Admin under the Site-wide category, unless you specify the group key with either post or homepage.

For checking the specific value of custom settings you can use the {{#match}} helper. Example, when a specific typography option is selected:

{{#match @custom.typography 'Inter'}}
  ...code for the Inter font...
{{/match}}

Additionally, you can add a custom description using the description property, and you can define the visibility of a setting. To control when settings are visible, include the visibility key on the dependent setting. This key specifies the conditions that must be met for the setting to be displayed.

Guideline and fallback

Most of the setting types require the "default" property, which is helpful in case the settings is not modified at all by the site owner. The one exception is the "text" type, where this is optional, but in such cases, there is a possibility to do it using handlebars. Expanding on the previous example:

<h1 class='hero__title'>
  {{#if @custom.hero_headline}}
    {{@custom.hero_headline}}
  {{else}}
    {{@site.title}}
  {{/if}}
</h1>

Important

The total number of settings is limited to 20.

Custom settings are intended for simple visual changes and not complex layout settings.

Official guideline for custom settings

Use cases & ideas

Let's see some of the possible use cases for custom theme settings in your Ghost theme:

  • secondary_color
    • provide an option for a secondary color for the theme
    • "type": "color"
  • default_color_scheme
    • site owner can set the default color scheme
    • "type": "select"
    • "options": ["System", "Light", "Dark"]
  • typography
    • provide different font family combinations
    • "type": "select"
  • sticky_header
    • option to make the header sticky
    • "type": "boolean"
  • post_feed_style
    • provide different style for the post feed
    • "type": "select"
    • "options": ["list", "grid"]
    • "group": "homepage"
  • open_external_links_in_new_tab
    • option to add script for opening external links in a new tab
    • "type": "boolean"

And there are much more general or even specific use cases where custom theme settings will be very useful.

In case you face issues like the theme settings reset during theme updates, you can use the GitHub action to deploy your theme, or check this guide on how to keep custom design settings.

Conclusions

Custom theme settings provide a way to make Ghost themes much easier to customize and change. Depending on what kind of settings your theme has, you can make specific changes without the need to touch any code.