Back to Documentations

Maxima Documentation

Theme version: 1.3.0 — 22 March 2021 Changelog

Theme Editing & Tools

Edit the theme files mentioned here with a code editor. I recommend Visual Studio Code, Sublime Text, or Atom. Don’t use TextEdit on Mac.

Once you finish, zip the theme files, and upload the final zip file to your Ghost website.

If editing the routes.yaml file, make sure to upload it after every change you make.


Watch the following short video tutorial about theme editing.


If you are looking for Ghost hosting, I recommend Ghost(Pro).

Table of Contents



Theme Installation

The first step is to unzip the downloaded package by double-clicking it on Mac or by right-clicking and selecting “Extract All” in Windows.

Inside the new folder maxima, you will find the maxima.zip theme file and an online documentation file.

Follow these steps to upload the theme to your website:

  1. Log in to your Ghost website admin (example.com/ghost).
  2. Click the settings icon ( ) at the bottom of the left-hand side.
  3. Go to Theme.
  4. Click Upload a theme and select the maxima.zip theme file.
  5. Once uploaded, click Activate now to activate Maxima.

Upload the routes.yaml File (⚑ Required)

The routes.yaml file is required for member sign up, and subscription flows.

To upload the file, follow these steps:

  1. Unzip the maxima.zip theme file.
  2. In your Ghost admin, click the settings icon ( ) at the bottom of the left-hand side.
  3. Go to the Labs.
  4. Scroll down to the Routes section and click the Upload routes YAML button.
  5. Select and upload the routes.yaml file inside the theme folder.
Upload a routes file in Ghost

Note: upload routes.yaml after uploading the theme zip

There will already be a default routes.yaml file uploaded to Ghost. You need to upload your theme’s routes.yaml to override the default.

Upload the routes.yaml file separately after uploading your theme zip file.


Members / Subscriptions

Maxima has different user interface elements for membership feature.

  • Login In and Sign Up buttons in the sidebar
  • A post subscription form
  • If the post is set to Members Only, a Call to Action section on the Post page to encourage visitors to subscribe

Edit Plan Features

To edit plan features, edit the partials/signup-plans.hbs file.

Subscription plans in maxima

Remove ‘Log in’ and ‘Subscribe’ from Header

To remove Log in and Subscribe from the header, open the partials/header.hbs theme file using a code editor and remove lines 39 to 45. This will also remove the Account and Log out links, visible if logged in.

Once you finish, zip the theme files, and upload the final zip file to your Ghost website.

Remove Ghost Portal / The Bottom Right Button

This is the Ghost Portal button, and you can disable it from the Ghost admin. More information at Portal Look and feel.

Remove Ghost Portal

Membership Troubleshooting Tips

If for any reason the subscribe form does not work, or there is an error message, the following tips might help:

  1. First, make sure you run the latest version of Ghost.

  2. If you are self-hosting your website, make sure to set up the mail config. After doing that, restart your Ghost server.

  3. The website config URL should match the URL used to access the website, as described in the Ghost docs.

Enter the URL that is used to access your publication. If using a subpath, enter the full path, https://example.com/blog/. If using SSL, always enter the URL with https://..


If you still have an issue and using Ghost Pro, please reach out to the Ghost team.


There is nothing to do from the theme side. Also, you can try the original theme demo to double-check that everything is working fine.

For more information about Members, connecting Stripe, and setting the package price, check the official Ghost documentation.


You can add, edit, delete, and reorder navigation menu in Ghost Admin from the Settings → Navigation page.

Ghost navigation menu

To include a static page on your navigation menu, follow these steps.

First, type the page’s name as you’d like it appear on your menu in the label field.

Ghost label field

Next, click on the item’s URL. The blog URL will already be auto-populated. Add the page slug after the final /. When you’re satisfied with your page configurations, click the Save button.


To enable search, you’ll need to create a new Content API Key. Follow these steps to create your Key.

In the left-side menu of your Ghost admin, click Integrations then + Add custom integration.

Add new Ghost Custom integrations

Give the new integration a name, like “Search”, and click Create.

Name for the Ghost Custom integrations

A new Content API Key will be created. When you hover over it, a Copy button will appear. Click the button to copy the key to the clipboard.

Copy Ghost Custom integrations Content API Key

Next, go to the Ghost admin Code Injection page. Access it from admin Settings > Advanced > Code Injection.

After replacing the CONTENT_API_KEY value with your Content API Key, add the following code to the Site Header box:

<script>
  var search_api_key = 'CONTENT_API_KEY';
</script>

It should look like this:

Inject Ghost Custom integrations Content API Key

Click Save.

The theme uses ghostHunter.

The search goes through the Post title and the content. It supports only Posts, not Pages.

The supported languages are German, Spanish, French, Portuguese, Italian, Finnish, Dutch, Turkish, and Danish.

If you have a large amount of content on your website, the search might become slow.

The issue is that Ghost does not have a built-in search feature so, to solve this and add search, a third-party library is used. In this case, the ghostHunter library.

This solution works well for most websites, but if the content is too large, it becomes a bit slow as the search happens on the user browser side, and all the data will be loaded before the search is happening.

There are currently two solutions:

1. Search only on the post title and ignore the content

This will improve search performance and reduce the loaded content. If this sounds fine, download this app.min.js file and replace it with your theme assets/js/app.min.js.

For reference, what I did was removing the post text from the request API in the assets/js/ghosthunter.js theme file. So line 108 becomes the following.

var url = site_url + "/ghost/api/v4/content/posts/?key=" + search_api_key + "&limit=all&fields=id,title,url,created_at,feature_image";

Instead of.

var url = site_url + "/ghost/api/v4/content/posts/?key=" + search_api_key + "&limit=all&fields=id,title,url,created_at,feature_image&formats=plaintext";

This is done in the theme development mode to generate the final app.min.js file loaded in the theme.

2. Using another search tool

Use another tool like Google Search, Elasticsearch, or Algolia. I have not tried them out, but here are a few resources at Ghost.


Tags Page

Follow these steps to create the Tags page:

  1. From the Ghost admin Pages section, create a new page and give it a title, like “Tags”.
  2. From Page settings, select the Tags template.
  3. Publish the page.
  4. To add the page to the navigation, please check the Navigation section above.
Ghost Tags Page

Note for Self-hosters

If you are self-hosting your website, you may need to do a server restart. This should get the Tags option to show up in the Template dropdown.


Disqus

To enable Disqus as a comments system, open the partials/disqus.hbs theme file using a code editor. Replace the aspirethemes-demos value with the disqus_shortname variable to match your Disqus account shortname.

var disqus_shortname = 'aspirethemes-demos';

So, if your Disqus shortname is exampleone, the final code above should be:

var disqus_shortname = 'exampleone';

Once you finish, zip the theme files, and upload the final zip file to your Ghost website.

From the theme side, that’s all you need to set up Disqus. If you have any issues with comments not loading, make sure you have registered your website with Disqus (Step 1).

If you still have issues, check the Disqus troubleshooting guide.

Disable Disqus

To disable Disqus comments, open the post.hbs theme file using a code editor and delete the line containing the {{> disqus}} text (line 95).

Once you finish, zip the theme files, and upload the final zip file to your Ghost website.

Disable Disqus Recommendations/Ads

Checkout the Disqus Recommendations documentation.

Disable Disqus Recommendations/Ads

Disqus Issues

If you have any issue with Disqus redirecting to any advertising pages, please disabled Tracking and Affiliate Links from your Disqus account.

Check out Keegan Leary’s blog post about this issue at https://keeganleary.com/disqus-is-evil-trash/.

Also, be aware of Disqus trackings. Check out https://supunkavinda.blog/disqus.

So, you might want to use another commenting system.

Thanks for sharing, Keegan!


Posts Per Page

You can control how many posts display per page from the package.json file.

"config": {
  "posts_per_page": 16
}

The theme default value is set to 16 posts per page.


Google Analytics

To integrate Google Analytics, I recommend using the Google Analytics integration by Ghost.


Update Favicon

You can change the favicon in Ghost from Admin > General > PUBLICATION IDENTITY > Publication icon.

Update Ghost CMS favicon

Responsive Tables

Responsive tables are required and essential for adding tabular content and allowing tables to be scrolled horizontally. You can make any table responsive across all viewports by wrapping a table with .responsive-table, for example:

<div class='responsive-table'>
  <table>
    ...
  </table>
</div>

Social Sharing Icons

You can customize and update a post’s social media sharing icons from the partials/share.hbs theme file.


Footer social media links are placed in the partials/footer.hbs file.

Ghost supports adding Facebook and Twitter profile URLs from the admin panel. Go to General > Social accounts and add your URLs. This will update Facebook and Twitter URLs within the footer social media section.

Ghost CMS Theme Social Accounts

Available Social Media Icons

The theme uses Evil Icons to provide simple and clean icons for other social accounts. Here you can find a list of the social media icons to use:

Facebook

<span class='c-social-nav__icon' data-icon='ei-sc-facebook' data-size='s'></span>

GitHub

<span class='c-social-nav__icon' data-icon='ei-sc-github' data-size='s'></span>

Instagram

<span class='c-social-nav__icon' data-icon='ei-sc-instagram' data-size='s'></span>

LinkedIn

<span class='c-social-nav__icon' data-icon='ei-sc-linkedin' data-size='s'></span>

Odnoklassniki

<span class='c-social-nav__icon' data-icon='ei-sc-odnoklassniki' data-size='s'></span>

Pinterest

<span class='c-social-nav__icon' data-icon='ei-sc-pinterest' data-size='s'></span>

Skype

<span class='c-social-nav__icon' data-icon='ei-sc-skype' data-size='s'></span>

SoundCloud

<span class='c-social-nav__icon' data-icon='ei-sc-soundcloud' data-size='s'></span>

Telegram

<span class='c-social-nav__icon' data-icon='ei-sc-telegram' data-size='s'></span>

Tumblr

<span class='c-social-nav__icon' data-icon='ei-sc-tumblr' data-size='s'></span>

Twitter

<span class='c-social-nav__icon' data-icon='ei-sc-twitter' data-size='s'></span>

Vimeo

<span class='c-social-nav__icon' data-icon='ei-sc-vimeo' data-size='s'></span>

VK

<span class='c-social-nav__icon' data-icon='ei-sc-vk' data-size='s'></span>

Youtube

<span class='c-social-nav__icon' data-icon='ei-sc-youtube' data-size='s'></span>

Languages

Maxima ships with many languages already. But if you’d like to add another one, you’ll be able to do that too.

Theme Translation

Maxima supports Ghost i18n and comes with German, Italian, Spanish, French Finnish, Portuguese Dutch, Turkish and Danish translation.

To use a language other than English, go to your Ghost admin Settings > General > PUBLICATION INFO and enter the ISO Code into the Publication Language field.

The following is a list of the available theme languages with the code to use.

  • da for Danish
  • de for Germany
  • du for Dutch
  • en for English
  • es for Spanish
  • fi for Finnish
  • fr for French
  • it for Italian
  • pt for Portuguese
  • tr for Turkish
Ghost Publication Language Setting

Add a New Language Translation

If the theme does not have a translation for your language, follow the following steps to add a new language translation.

  1. Create a new file using a code editor in the theme’s locales folder with the ISO Language Codes code. Foe example, if the new language is Japanese, the ISO code will be jaand the file name will be ja.json.
  2. In the same locales folder, open the en.json file and copy its content into your new language file.
  3. Start translating, as shown in the following Edit Translation section.
  4. Go to your Ghost admin Settings > General > PUBLICATION INFO and enter your language ISO code into the Publication Language field. For example, ja.
  5. Click Save settings.

Once you finish, zip the theme files, and upload the final zip file to your Ghost website.

You may want to restart Ghost or deactivate and activate the theme again to make the new changes effective.

Edit Translation

To improve or edit a translation in a specific available language, you can open the language file using a code editor in the locales folder:

|____locales
| |____da.json
| |____de.json
| |____du.json
| |____en.json
| |____es.json
| |____fi.json
| |____fr.json
| |____it.json
| |____pt.json

For example, the German translation file looks like this:

{
  "Next": "Weiter",
  "Previous": "Zurück",
  " (Page %)": " (Seite %)",
  "Page Not Found": "Seite nicht gefunden",
  "Home Page": "Startseite",

  "Featured Post": "Featured Artikel",

  "Share on Twitter": "Auf Twitter teilen",
  "Share on Facebook": "Auf Facebook teilen",
  "Share on Pinterest": "Auf Pinterest teilen",

  "Search": "Suche",
  "Search {blogtitle}": "Suche {blogtitle}",
  "Type to Search": "Tippe um zu suchen",

  "Published with {ghostLink} & {themeLink}": "Veröffentlicht mit {ghostLink} & {themeLink}",

  "Email": "E-Mail",
  "Account": "Konto",
  "Log In": "Einloggen",
  "Log Out": "Ausloggen",
  "Continue": "Fortsetzen",
  "Subscribe": "Abonnieren",
  "Subscribe Now": "Abonniere jetzt",
  "Enter your email below to join our newsletter": "Geben Sie Ihre E-Mail-Adresse unten ein, um unserem Newsletter beizutreten",
  "Please check your inbox and click the link to complete the login.": "Bitte überprüfen Sie Ihren Posteingang und klicken Sie auf den Link, um die Anmeldung abzuschließen.",
  "Please check your inbox and click the link to confirm your subscription.": "Bitte überprüfen Sie Ihren Posteingang und klicken Sie auf den Link, um Ihr Abonnement zu bestätigen.",
  "Please enter a valid email address!": "Bitte geben Sie eine gültige E-Mail-Adresse ein!",
  "An error occurred, please try again later.": "Ein Fehler ist aufgetreten. Bitte versuchen Sie es später erneut.",

  "Already have an account?": "Hast du schon ein Konto?",
  "Don't have an account yet?": "Sie haben noch keinen Account?",

  "This post is for paying subscribers only": "Dieser Beitrag ist nur für zahlende Abonnenten",
  "This post is for subscribers only": "Dieser Beitrag ist nur für Abonnenten",

  "Choose your subscription": "Wählen Sie Ihr Abonnement",
  "Unlock full access to {siteTitle} and see the entire library of members-only content & updates.": "Schalte den vollen Zugriff auf {siteTitle} frei und sieh dir die gesamte Bibliothek mit Inhalten und Updates nur für Mitglieder an.",
  "Subscribe to {siteTitle}": "Abonnieren bei {siteTitle}",
  "Choose this plan": "Wählen Sie diesen Plan",
  "Monthly": "Monatlich",
  "Yearly": "Jährlich",
  "month": "Monat",
  "year": "Jahr",

  "Welcome back!": "Willkommen zurück!",
  "Log Into your account again.": "Melden Sie sich erneut in Ihrem Konto an.",
  "Send login link": "Anmeldelink senden",

  "Nice, you're a subscriber!": "Schön, dass Sie Abonnent sind!",
  "You have an active {siteTitle} account with access to all posts.": "Sie haben ein aktives {siteTitle} Konto mit Zugriff auf alle Posts.",
  "You're a subscriber to free members updates": "Sie sind Abonnent der kostenlosen Mitgliederaktualisierungen",
  "You are subscribed to free updates from {siteTitle}, but don't have a paid subscription to read all the posts.": "Sie haben kostenlose Updates von {siteTitle} abonniert, haben jedoch kein kostenpflichtiges Abonnement, um alle Beiträge zu lesen."
}

Each line consists of a left key ("Next") and a right value ("Weiter").

The key is plain English that exists in all translation files and should not be changed. You should change only the value.

If you have any suggestions to improve a current translation or add a new language, please contact me.

Portal Text & Translation

There is no way to change or translate the Portal text yet. The Portal is not part of the theme files but a core Ghost component.

I suggest reaching out to the Gost team ( support@ghost.org ); so they might work on this issue or have a workaround.


Syntax Highlighting

You can add a fenced code block by placing triple backticks ``` before and after the code block. For example:

```
pre {
  background-color: #f4f4f4;
  max-width: 100%;
  overflow: auto;
}
```

Will produce the following gray look:

Maxima Ghost Theme Syntax Highlighting

To highlight a code block, add the language alias like css or js to the code block. For example, the CSS code in the previous example will wrap between ```css and ``` as follows:

```css
pre {
  background-color: #f4f4f4;
  max-width: 100%;
  overflow: auto;
}
```

This will produce the following colored look:

Maxima Ghost Theme Syntax Highlighting with prismjs

To add inline code, wrap the text between two backticks ` `.

Prism

Maxima ships with Prism.js, a lightweight, robust, and elegant syntax highlighter.

The initial Prism package includes some languages, like Markup, CSS, C-like, and JavaScript.

You can add support for more languages. For example, to add support for PHP, get the PHP component script from Prism CDN.

<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.13.0/components/prism-php.js"></script>

From the side admin menu, go to Code Injection and add the script to the Site Footer section. Be sure to click Save.

Maxima Ghost Theme Syntax Highlighting Code Injection PHP Prism

Theme Deploy with GitHub Actions

Maxima comes integrated with the Deploy Ghost Theme Github action. The purpose of the GitHub action is to take the theme from the GitHub repo and send it to your website.

Maxima documentation Ghost CMS Theme GitHub Actions

I have written about this at How to Deploy Your Ghost Theme Using Github Actions. All you need to do is follow steps 1 and 2.

The Deploy Ghost Theme action is developed by Ghost and works with any Ghost install whether you self-host Ghost or using Ghost Pro.


Code Injection

Another choice for customization is to use the Ghost Code Injection settings in Ghost admin.

For a CSS example, you can use the following code in the Site Header section to change the logo color and font size.

<style>
  .c-logo__link {
    color: #4550E5;
    font-size: 32px;
  }
</style>

Watch the following short video about Ghost Code Injection, how it works, and how to use it.


You can update the footer copyright line information from the theme partials/footer.hbs file.


AMP

The AMP integration in Ghost is enabled by default, but if you prefer not to use the feature then you can turn it off in the settings within Ghost Admin.

Read more about AMP at Google AMP + Ghost

The theme didn’t have an AMP file; the Ghost default/core one will be used instead. If you want to customize it, you can add the default Ghost template to the theme folder and customize it.


Theme Development

If you are a developer and need to do heavy customization work, the theme uses Gulp to compile Sass and JavaScript. This improves the development flow and makes it much faster.

Adding your custom code to Code Injection is always recommended to avoid redoing your customizations with future theme updates.

Changing any .hbs file, for example, post.hbs, does not require being in development mode with gulp running. Just edit the file in your preferred editor and upload it.

First, make sure you have Node.js, npm, Gulp CLI, and Bower installed. Check My Current Setup.

Run the following command in the theme root directory to install npm and bower dependencies.

npm install

To start Gulp, run:

gulp

This will compile Sass and JavaScript files and start watching changes as you edit files.

Gulp will produce two files:

assets/js/app.min.js: The final main JavaScript file.

This file is generated from many other JavaScript files listed in the gulpfile.js file. Gulp will do all the work to create that file, so no manual work is needed.

Gulp will watch your changes in the assets/js/app.js or assets/js/ghosthunter.js (if exist) and will then generate the final app.min.js file.

partials/compiled/inline-css.hbs: The final CSS file.

This file is generated from the assets/css/style-min.css file, which was generated by Gulp. It is used as an Internal CSS in the theme partials/head.hbs.

If you are working with Gulp, it’s recommended you avoid editing these files. Instead, do customizations in assets/sass for CSS or in assets/js/app.js JavaScript. This way, you can make sure the flow is going in the right direction and never lose any changes.


My Current Setup

In case you are wondering what my current environment set up is and which package versions I use, take a look at the following:

$ node -v
v14.16.1

$ npm -v
7.13.0

$ bower -v
1.8.12

$ gulp -v
CLI version: 2.3.0
Local version: 4.0.2

This environment works well for running Ghost and also for theme development.

I use macOS Big Sur.


Zip Theme Files

To create a zip file after your theme changes, you can use one of the following options.

Use one of the first two options if you are on a Theme Development mode.

Using the command line

zip -r maxima.zip maxima -x '*node_modules*' '*bower_components*'

This will exclude the node_modules and bower_components directories from the final zip file.

Using Gulp

If you are running gulp, you can type the gulp zip command to do this.

Using your computer program

You can compress it as a standard folder just like you do with any other folder on your computer. If you are on Mac, right-click on it to view the context menu. Then, click the “Compress” option.


Theme Update

You may be wondering: how can I update my theme to the latest theme version?

There are two choices:

  • Keep your current theme and replace only the changed files from the new version. You can find the modified files on the theme page Changelog
  • Use the latest version as a starting point and redo your theme changes and customizations

One way to reduce the need for redoing customizations is to use the Code Injection tool. This is very helpful for adding custom CSS and tracking code. Keeping your custom CSS code with Code Injection is always recommended.


Your feedback is very welcome ♥

I’m open to your feedback and hear your experience about my themes and work. If you have a few minutes, please send your thoughts through this Google Form.

Thank you for your time!

Support

Have any questions? I’m here to help.

Contact Ahmad
Ahmad Ajmi