✨ Flair — a customizable, stylish theme for your blogExplore

Maali Documentation

Maali theme documentation, covering theme installation, routes setup, custom settings, theme development and more.
Last update: May 12, 2023

Theme compatibility

Maali v1.3.0 for Ghost 5.x

100/100

Compatible Ghost version: v5.9 or any newer version.

Starting with theme version v1.1.3 you need Ghost v5.54.1 or later.


Install the theme

Follow the steps below to upload the theme:

  1. Log in to your publication admin section at yoursite.com/ghost/
  2. Go to Settings > Design ( yoursite.com/ghost/#/settings/design/ )
  3. Click Change theme and then click Upload theme and select the maali.zip file.
  4. After the upload is complete click Activate

Routes Setup

For the theme to function properly you must upload the routes.yaml file.

Follow the steps below to upload the routes.yaml file (The file is located inside the zip)

  1. Log in to your publication admin section at yoursite.com/ghost/
  2. Go to Settings > Labs.
  3. Click on Upload routes YAML button and select the file from the root directory of the theme.
Ghost routes.yaml
Ghost routes.yaml

The routing file defines the following custom routes and collections:

  • / - the homepage (home.hbs)
  • /latest/ - the main collection, it also provides the RSS feed (/latest/rss/)
  • /archive/ - the archive template
  • /tags/ - custom template to showcase the tags
  • /authors - custom template to showcase authors
  • /membership/ - membership template
  • /signin/ - custom sign in page
  • /signup/ - custom sign up page
  • /account/ - custom account page

Custom Settings

The theme comes with custom design settings, which are accessible from the Ghost Admin panel. To view and edit these settings go to Settings > Design ( yoursite.com/ghost/#/settings/design/)

Custom settings are defined in the package.json file. These settings are placed under three categories:

  1. Site-wide settings
  2. Homepage settings
  3. Post settings

Site-wide

  • Color scheme - set the default color scheme (system, light, dark)
  • Font family - select from a predefined list of font families or use system fonts
  • Use portal links - set your signin, signup, and membership links to use the portal or custom pages
  • Sticky header - enable or disable the sticky header (default is non sticky)
  • Dark theme logo - upload the site logo for the dark version of the theme
  • CTA headline - the headline for CTAs (hero section, section above the footer, and post sidebar)
  • CTA description - the description for CTAs

Homepage

  • Hero layout - set the hero section style (check the hero section for more details)
  • Topic section slugs - set the tag slugs to render the topic sections on the homepage
  • Topic section layout - set the topic section style (mixed, 4x1, 2x2, 1+3)
  • Show post card excerpts - show or hide the post excerpts in the topic sections
  • Featured author slugs - set the author slugs to render the writers section

Post

  • Default post template - Set the default post template
  • Enable drop caps - enable or disable drop caps in articles

Homepage

The homepage layout is defined in the home.hbs file and has the following sections (besides the header and footer):

  • Hero
  • Subscribe CTA
  • Topic/tag sections
  • Writers section

Hero

The hero section is customizable from the Design Settings in the Ghost Admin. You have the following options to choose from:

  • 1 featured post - rendering the most recent featured post
  • 3 featured posts - rendering 3 featured posts
  • 4 featured posts - rendering 4 featured posts
  • 4 featured posts v2 - rendering 4 featured posts in a different way
  • 5 featured posts - rendering 5 featured posts

To feature a post, you have to set the Feature this post flag in the Post Settings.

The editor's picks section is populated by posts that have the internal tag #editors-picks. Internal tags must start with # symbol

Subscribe CTA

There is a Call-to-Action to subscribe right below the hero section, displayed for regular visitors. The headline and description can be set from the Site-Wide Design Settings: CTA headline, CTA description.

Subscribe CTA
Subscribe CTA

Topics

You have the possibility to set a list of tags, which will be used to render different topic sections on the homepage. There is no limit to the number of topics/tags you can provide, each section will fetch up to 4 articles with that tag.

Provide a list of tag slugs separated by commas (,) in the Design Settings > Topic section slugs.

Do NOT use the tag names, but the tag slugs. You can find the slug of a tag in your Admin > Tags, opening a specific tag and check the Slug field.

Example from the demo:

politics,business,technology,economy,science,health

The slug for multi-word tags most of the time has a dash(-) between the words. Example: Modern Art -> modern-art

You can also control the layout of the topic sections from the Design Settings > Topic section layout. You have the following options to choose from:

  • mixed - the default value, and it means each section will have a different style (the first topic section will use the 4x1 layout, the second section will use the 2x2 layout, the third section will use the 1+3 layout, then the next section will repeat the same pattern)
  • 4x1 - when selected, each topic section will display articles in 4 columns (on desktop)
  • 2x2 - when selected, each topic section will display articles in 2 columns and each column has 2 articles (on desktop)
  • 1+3 - when selected, each topic section will display articles in 2 columns and the first columns has one article while the second column has 3 articles (on desktop)

Writers

You can feature specific authors on the homepage, you have to a provide a list of author slugs separated by commas (,) in the Design Settings > Featured author slugs.

Do NOT use the author names, but the author slugs. You can find the slug of an author in your Admin > Staff, opening a specific author and check the Slug field.

Example from the demo:

david,annie,james,kate

Each author will be rendered with some basic information (name, bio, social links) as well as up to 3 articles by that author.


Custom Pages

As explained in the routes setup, the theme comes with a couple of custom pages, to activate these pages, there are some actions you have to take.

Uploading the routes.yaml file is a key requirement for these custom pages.

By default, that is the only requirement, but if you want even more control over the pages then you should activate the data property (remove the # symbol in front of the data property in the routes.yaml file) and create the page with the correct slug.

To create a Page:

  1. Log in to your publication admin section at yoursite.com/ghost/
  2. Go to Pages ( yoursite.com/ghost/#/pages/ )
  3. Click New page and set the Title and Page URL
  4. Finally, click Publish

The data property can be used to make templates dynamic that otherwise would be static.

Latest

Defined by the latest.hbs template, renders the latest articles.

If you want to control the meta properties for this page, you have to activate the data property, by removing the # symbol in the routes.yaml file.

/latest/:
  permalink: /{slug}/
  template: latest
  # data: page.latest # When active data will be taken from the  "/latest/" page

If you activated the data property, you also have to create the page with the latest slug.

Archive

Defined by the archive.hbs template, renders articles in chronological order and grouped by month (by the Published Date).

If you want to control the meta properties for this page, you have to activate the data property, by removing the # symbol in the routes.yaml file.

/archive/:
  controller: channel
  template: archive
  # data: page.archive # When active data will be taken from the  "/archive/" page

If you activated the data property, you also have to create the page with the archive slug.

Membership

Defined by the membership.hbs template, renders all tiers with price and benefits.

The membership tier names, prices, and benefits can all be changed in the Admin, by going to Settings > Membership ( /ghost/#/settings/members). Edit existing tiers or add new ones under the Membership Tiers section.

If you want to control the meta properties for this page, you have to activate the data property, by removing the # symbol in the routes.yaml file.

/membership/:
  template: membership
  # data: page.membership # When active data will be taken from the  "/membership/" page

If you activated the data property, you also have to create the page with the membership slug.

Signup

Defined by the signup.hbs template.

If you want to control the meta properties for this page, you have to activate the data property, by removing the # symbol in the routes.yaml file.

/signup/:
  template: signup
  # data: page.signup # When active data will be taken from the  "/signup/" page

If you activated the data property, you also have to create the page with the signup slug. Additionally, the feature image of this page will appear on the side.

Signin

Defined by the signin.hbs template.

If you want to control the meta properties for this page, you have to activate the data property, by removing the # symbol in the routes.yaml file.

/signin/:
  template: signin
  # data: page.signin # When active data will be taken from the  "/signin/" page

If you activated the data property, you also have to create the page with the signin slug. Additionally, the feature image of this page will appear on the side.

Account

Defined by the account.hbs template.

If you want to control the meta properties for this page, you have to activate the data property, by removing the # symbol in the routes.yaml file.

/account/:
  template: account
  # data: page.account # When active data will be taken from the  "/account/" page

If you activated the data property, you also have to create the page with the account slug.


Custom templates

The default post layout is defined by the post.hbs template and the default page layout is defined by the page.hbs template.

You can change the default post template from the Design Settings > Post > Default post template.

The theme comes with several custom templates, which can be selected for individual posts from the Post Settings menu.

Custom templates:

  • custom-with-image-on-the-side.hbs - template that displays the feature image on the side
  • custom-with-wide-image.hbs - simple template with a wide feature image
  • custom-with-full-width-image.hbs - template that displays the feature as full-width (respecting site-width - 1400px by default)
  • custom-with-sidebar.hbs - template that includes a sidebar next to the post content with links to featured posts and the latest articles
  • custom-with-toc.hbs - template that includes a table of contents on the left side

If you want to edit the templates these are in the root directory of the theme.


Maali comes with a custom feature to create dropdown menus easily for your header navigation. All you have to do is add the minus sign (-) in front of the items in Settings > Navigation

Items having the - sign will be added as subitems to the previous navigation item. For example from the demo:

  • - Membership, - Sign up and - Sign in will belong to the Members item
Maali dropdown menu setup
Maali dropdown menu setup

Color customization

You can change the main accent color from Settings > Design > Brand. The most important CSS configurations of the theme are defined as custom CSS properties, so you can easily overwrite them from code injection to change background colors, text colors, and more.

The theme comes with light and dark color schemes (and system), the default one can be set in the admin using the Default color scheme in Settings > Design > Site-Wide.

The included color schemes:

  • light
  • dark

The default option is system which will be either the dark or light theme, depending on the user's preference.

It's possible to change the color schemes by changing the properties. This can be done by adding the following in code injection and adjusting the values.

To change the light theme:

<style>
  :root {
    /* color configuration */
    --color-text: hsl(0 0% 15%);
    --color-text-acc: hsl(0 0% 25%);
    --color-text-reverse: hsl(0 0% 85%);
    --color-bg: hsl(0 100% 100%);
    --color-bg-acc: hsl(0 0% 97%);
    --color-bg-reverse: hsl(0 0% 15%);
    --color-bg-base: 0 0% 100%;
    --color-bg-base-reverse: 0 0% 0%;
    --color-neutral: hsl(0 0% 50%);
    --color-border: hsl(0 0% 92%);
  }
</style>

To change the dark theme:

<style>
  html[data-color-scheme='dark'] {
    --color-text: hsl(0 0% 85%);
    --color-text-acc: hsl(0 0% 75%);
    --color-text-reverse: hsl(0 0% 15%);
    --color-bg: hsl(0 100% 100%);
    --color-bg-acc: hsl(0 0% 97%);
    --color-bg-reverse: hsl(0 0% 15%);
    --color-bg-base: 0 0% 100%;
    --color-bg-base-reverse: 0 0% 0%;
    --color-neutral: hsl(0 0% 50%);
    --color-border: hsl(0 0% 20%);
  }
</style>

Some useful tools for choosing colors and gradients:

You can even define your color schemes, but that would require changing the theme files. Steps to define new color schemes:

  1. Change the package.json file, adding a new option under the color_scheme property.
  2. Add the new color scheme to the dropdown editing the partials/color-scheme-dropdown.hbs
  3. Add the CSS, either in code injection (using the previous code blocks as a template) or in the CSS files.

Ghost config

Some configurations in Ghost themes can be defined in the package.json file, including Posts per page, Image sizes, and Custom settings.

Posts per page

The posts_per_page defines the number of posts that appear in your collections until it's paginated. For example, the value of posts_per_page is used on the home page, tag, and author templates.

By default, this is set to 12, and you can change it in the package.json file:

"config": {
  "posts_per_page": 12
}

Image sizes

Ghost can handle responsive image sizes, and this is defined in the package.json file, under the image_sizes property. You can change the default configuration by editing this file before uploading the theme.

"image_sizes": {
  "xxs": {
    "width": 30
  },
  "xs": {
    "width": 100
  },
  "s": {
    "width": 300
  },
  "m": {
    "width": 600
  },
  "l": {
    "width": 1000
  },
  "xl": {
    "width": 2000
  }
}

The image sizes defined there will be used to generate copies of images at the specified sizes when uploading images in Ghost Admin.

The theme also comes with the lazysizes library for lazyloading images, to improve performance.

When it comes to aspect ratios, the postcards have an aspect ratio of 16/9.

The aspect ratio in the post layouts differs based on the template used and device size.


Syntax Highlighting

The theme comes with prism.js integration by default, to activate syntax highlighting just add the internal tag #syntax-highlight to your post.

Why is this necessary? In short, for performance. To avoid loading the library when it's not necessary. If you don't add the tag, the library will not load at all.

If you are someone who shares code regularly and wants to have the plugin on all your posts, without having to add the tag, you can do so by changing the partials/syntax-highlight.hbs file. Simply remove the condition checking for the tag.

Additionally, in this partial file, it's defined which version of the prism library is loaded as well as the components, languages, and theme. So you can easily customize it, add new languages, or a different code highlighting the theme without having to go into theme development.


Table of Contents

The Table of contents is generated using the TocBot library and this is integrated into the theme by default. There is a custom template that includes the ToC functionality.

You have the possibility to make the With Toc template the default post template from Settings > Design > Post > Default post template or otherwise you can activate it for specific posts only from the Post Settings > Template.

If you want to make changes to the ToC layout or the TocBot library configuration, you can edit the partials/toc.hbs file.


Comments

Maali comes with the native comment feature that Ghost offers. The Native Comment System requires at least Ghost v5.9.0, you have to enable it from Settings > Membership > Commenting.

By default, native comments are not active, so you have to select either All members or Paid-members only


Google Fonts

You can set the font family from the Admin section, going to Settings > Design > Site-wide and under Font family select one of the options.

The theme comes with the following options:

  • System font - loads the system font (no requests to Google Fonts)
  • Poppins & Lora - Poppins for headings and Lora for body font
  • Cinzel & Fauna One - Cinzel for headings and Fauna One for body font
  • DM Serif Display & DM Sans - DM Serif Display for headings and DM Sans for body font
  • Inter - Inter for both headings and body
  • Manrope & Bitter - Manrope for headings and Bitter for body font
  • Libre Baskerville & Source Sans Pro - Libre Baskerville for headings and Source Sans Pro for body font
  • Outfit - Outfit for both headings and body font
  • Playfair Display & Inter - Playfair Display for headings and Inter for body font
  • Bitter - Bitter for both headings and body

With the System font option, you can avoid requests to the Google servers in case GDPR is a concern.

If you still want to use Google fonts and want to self-host the font files check out this guide for self-hosting Google Fonts.


Icons

The icons used in the theme are from Tabler Icons, the library consists of 4000+ icons. Not all icons from the library are included to save on the file size, but the most common icons are included in the partials/icons directory.

Inside the partials/icons directory, you can find all included icons, in separate .hbs files.

Here are the steps to add new icons:

  1. Go to Tabler Icons and click on the Icon you want to add, this will copy the code to your clipboard.
  2. Go into the partials/icons directory and create a new file: your-icon.hbs
  3. Open the new file and paste the copied code from the clipboard.
  4. Save the file.

For using the icons inside the theme files, there is a special partial file partials/icon.hbs which accepts name and size as parameters.

Let's see an example and try to add a new icon. Assuming we want to add the icon camera and by clicking on the icon on the website, we get this code:

<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-camera" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="#2c3e50" fill="none" stroke-linecap="round" stroke-linejoin="round">
  <path stroke="none" d="M0 0h24v24H0z" fill="none"/>
  <path d="M5 7h1a2 2 0 0 0 2 -2a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1a2 2 0 0 0 2 2h1a2 2 0 0 1 2 2v9a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-9a2 2 0 0 1 2 -2" />
  <circle cx="12" cy="13" r="3" />
</svg>

The next step is to create a new file: partials/icons/camera.hbs and paste the copied code in the file. The new file must be of .hbs type, so we can use it into the theme files:

{{>icon name="camera" size="lg"}}

Social links are shown in the footer and by default, the theme comes with:

  • Facebook (Settings > General > Social accounts)
  • Twitter (Settings > General > Social accounts)
  • RSS

To add other links you need to edit the partials/social-links.hbs file. There are several other links in there already, you just have to uncomment the relevant parts and add your link in the href attribute.


Social sharing

Social sharing is part of the post layout and the following is included:

  • Twitter
  • Facebook
  • Linkedin
  • Email
  • Copy to clipboard

To add other social sharing options you need to edit the partials/social-share.hbs file.


Translations

By default, everything is in English (en.json), additionally, the theme comes with translations in:

  • 🇩🇪 German (de.json)
  • 🇪🇸 Spanish (es.json)
  • 🇫🇷 French (fr.json)
  • 🇮🇹 Italian (it.json)
  • 🇳🇱 Dutch (nl.json)
  • 🇵🇹 Portuguese (pt.json)
  • 🇹🇷 Turkish (tr.json)

For a translation to apply, you have to set the language in Settings > General > Publication language.

If you want to edit the translation in a specific language, you have to edit the corresponding translation file. The files are stored in the locales directory (inside the theme zip).

|__ locales
|   |__ de.json
|   |__ en.json
|   |__ es.json
|   |__ fr.json

If the language file for your language doesn't exist, you have to create it (make sure to use the correct language code) The best way is to copy the content en.json file in your new language file, then change the translations.


Theme development

If you want to make more advanced changes to the theme, or you want to develop your components, the theme comes with a developer-friendly setup. You can take advantage of the Gulp tasks that are set up for compiling Javascript and PostCSS.

All the assets are combined and minified for better speed and performance. To customize the theme make sure you have Node.js and npm installed.

Follow the official guide for installing Ghost locally. After you have installed Ghost and put the theme directory inside the content/themes/ directory, run the following commands in the theme directory:

npm install

This will install all the dependencies for the theme

Then run:

gulp

This will compile PostCSS and javascript and will watch for changes. So when you edit a .hbs, .css or .js file the change will trigger the gulp watch task and this will compile the assets whenever you change a file.

If you want to compile just CSS:

gulp css

If you want to compile just JS:

gulp js

FAQ & Code Snippets

Frequently asked questions and useful snippets you can use to make some quick changes to your site.

  • How to resize the header logo?

    Go to the Admin, Settings > Code Injections and in the Site Header add (adjust the height value depending on your preference):

    <style>.header__brand img { height: 42px; max-height: none; }</style>
    
  • How to resize the footer logo?

    Go to the Admin, Settings > Code Injections and in the Site Header add (adjust the height value depending on your preference):

    <style>.footer__brand img { height: 50px; max-height: none; }</style>
    
  • How to remove the color scheme dropdown?

    Go to the Admin, Settings > Code Injections and in the Site Header add:

    <style>.color-scheme { display: none; }</style>
    

Support

Don't hesitate to reach out if you need help or have any suggestions.

Contact - Feedback

Ghost Pro Hosting

Get the best managed Ghost CMS hosting and focus on bringing value to your audience.