Back to Documentations

Hue Documentation

Theme version: 1.0.9 — 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 hue, you will find the hue.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 Design > Change theme.
  4. Click Upload theme and select the hue.zip theme file.
  5. Once uploaded, click Activate now to activate Hue.

Upload the routes.yaml File (⚑ Required)

The routes.yaml is required for the following reasons:

  • Supports members sign up flows and subscriptions
  • Show the posts tagged with the podcast tag on the homepage
  • Show the posts tagged with the blog tag on the blog page

To upload the file, follow these steps:

  1. Unzip the hue.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.

Do this separately after uploading your theme zip file.


Members / Subscriptions

Hue has different interface elements for membership feature.

  • Log in and Subscribe buttons in the header
  • Homepage Hero section subscription form
  • Call to action section on the post page to encourage visitors to subscribe if the post is for members only

Members / Subscription Theme Files

To edit the /subscribe/ page, you can edit the members/subscribe.hbs file.

The members/signin.hbs file for the /signin/ page.

The members/account.hbs file for the /account/ page.

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 19 to 25. 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.

If you want to use the Ghost Portal for the theme header Login and Subscribe links, you can update the links href value to use the Portal Links value.

So, for example, for the header Log in link in the theme partials/header.hbs file, change the href value from {{ @site.url }}/signin/ to #/portal/signin. Change {{ @site.url }}/subscribe/ to #/portal/signup for the Subscribe link. You got the point.

You can find all the Portal custom links from the Ghost admin Portal Links section. For more information, please visit Ghost Members documentation.

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

Remove ‘Public’, ‘Members’ and ‘Paid’ Labels from Post Card

Open the partials/post-card.hbs file and remove lines 23 to 29.

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

Or, copy and paste the following CSS code into the Ghost admin Code Injection Site Header.

<style>
  .c-post-card__visibility {
    display: none;
  }
</style>

Embed the Subscribe Form in the Middle of a Blog Post

To add the Subscribe Form in the middle of a blog post, click on the + button and choose the HTML card.

Ghost HTML CARD

Then paste the following code into the editor field and save your post.

<form data-members-form="subscribe" class="c-subscribe-form" style='background: var(--bg-gray); padding:16px;'>
  <div class="form-group">
    <label for="subscribe-email" class="u-hidden-visually">Your email</label>
    <input type="email" name="email" class="c-subscribe-form__input" id="subscribe-email" placeholder="Your email address" data-members-email="">
    <button type="submit" value="Subscribe" class="c-btn c-btn--action c-subscribe-form__btn">Subscribe</button>
  </div>

  <div class="u-alert u-alert--success u-mt-16">Please check your inbox and click the link to confirm your subscription.</div>
  <div class="u-alert u-alert--invalid u-mt-16">Please enter a valid email address!</div>
  <div class="u-alert u-alert--error u-mt-16">An error occurred, please try again later.</div>
</form>
Subscribe Form Embed

You may be asking, how I got the form HTML code above? Well, you can copy it from your blog or the theme demo source code. You can do this by opening your browser DevTools and select the form element and copy it. Like the following screenshot.

Subscribe Form Embed Source Code

You can use Chrome DevTools or Firefox Developer Tools. To open the DevTools, right-click on an element on the page and choose Inspect, then the Elements panel will open. Also, you can press Command+Option+C (Mac) or Control+Shift+C (Windows, Linux, Chrome OS) to open the Elements panel.

Edit Plan Features

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

Subscription plans in hue

Add Free Plan Column to Subscribe Page

To add a free column plan to the Subscribe page, you can create another column in the theme partials/signup-plans.hbs file by copying one of the current columns code.

Fill in your information like a list of benefits and so on.

For the button, add a link to the {{ @site.url }}/signup/ page so the button like will be like:

<a class='c-btn c-btn--outline' href='{{ @site.url }}/signup/'>Free</a>

Your partials/signup-plans.hbs theme file might end up like this.

<div class='c-member-plans'>

  <!-- Free Plan Column -->
  <div class='c-member-plan'>
    <header class='c-member-plan__header'>
      <h3 class='c-member-plan__title'>{{t 'Free'}}</h3>
      <span class='c-member-plan__sign'></span>
      <strong class='c-member-plan__amount'></strong>
    </header>
    <div class='c-member-plan__content'>
      <ul class='c-member-plan__list'>
        <li>Regular updates with new content</li>
        <li>Support independent publishing</li>
        <li>Simple, secure card payment</li>
      </ul>
      <a class='c-btn c-btn--outline' href='{{ @site.url }}/signup/'>Free</a>
    </div>
  </div>

  <!-- Monthly Plan Column -->
  <div class='c-member-plan'>
    <header class='c-member-plan__header'>
      <h3 class='c-member-plan__title'>{{t 'Monthly'}}</h3>
      <span class='c-member-plan__sign'>{{ price currency=@price.currency }}</span>
      <strong class='c-member-plan__amount'>{{ @price.monthly }} </strong> {{ @price.currency }} / {{t 'month'}}
    </header>
    <div class='c-member-plan__content'>
      <ul class='c-member-plan__list'>
        <li>Full access to all private posts</li>
        <li>Regular updates with new content</li>
        <li>Support independent publishing</li>
        <li>Simple, secure card payment</li>
      </ul>
      <a class='c-btn c-btn--action' href='javascript:void(0)' data-members-plan='Monthly'>{{t 'Choose this plan'}}</a>
    </div>
  </div>

  <!-- Yearly Plan Column -->
  <div class='c-member-plan'>
    <header class='c-member-plan__header'>
      <h3 class='c-member-plan__title'>{{t 'Yearly'}}</h3>
      <span class='c-member-plan__sign'>{{ price currency=@price.currency }}</span>
      <strong class='c-member-plan__amount'>{{ @price.yearly }}</strong> {{ @price.currency }} / {{t 'year'}}
    </header>
    <div class='c-member-plan__content'>
      <ul class='c-member-plan__list'>
        <li>Full access to all private posts</li>
        <li>Regular updates with new content</li>
        <li>Support independent publishing</li>
        <li>Simple, secure card payment</li>
        <li>One easy payment instead of 12!</li>
      </ul>
      <a class='c-btn c-btn--action' href='javascript:void(0)' data-members-plan='Yearly'>{{t 'Choose this plan'}}</a>
    </div>
  </div>

</div>

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

You may want to increase the column’s container for a wide columns so open the members/subscribe.hbs theme file using a code editor and change line 13 to the following line.

<div class='o-grid__col o-grid__col--center o-grid__col--4-4-m'>

The result will be like.

Hue Ghost Theme Membership Plan Features

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. If you are using any self-hosting provider, please reach out to them for help.


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.


Home Hero

Hue Ghost CMS Theme Homepage Hero

The hero section shows the following components:

  • Site Publication cover
  • Site description
  • Subscription form
  • Subscribe list with icons to show and link to different podcast services

You can edit them from the Ghost admin General settings admin page.

Publication Cover

  • Settings > General > Branding > Publication cover

Site Description

  • Settings > General > PUBLICATION INFO > Title & description

You can add normal HTML tags to the description like links or headings. The theme will automatically render them on the browser. For example, the demo description is the following:

<h3>Hue Podcast</h3><p>A Podcasting Theme for the Ghost CMS with membership and subscription built-in.</p>

The website’s title, which appears on the header, will not automatically visible in the hero description/tagline. Instead, you can add it as part of the blog description, like the example above.

Subscribe list

The theme comes with the following podcast services icons:

  • Apple Podcasts
  • Overcast
  • Spotify
  • Pocket Casts
  • Castro
  • Breaker
  • Google Podcasts
  • RadioPublic

To edit the list, open the partials/subscribe-list.hbs theme file using a code editor. In this file you can see all the available lists, three links are visible as an example, Apple Podcasts Overcast and Spotify.

Let’s see an example, the Spotify one.

<li class='c-subscribe-list__item'>
  <a href='#' class='c-subscribe-list__link' rel='noopener'>
    <div class='c-subscribe-list__media'>
      <img class='c-subscribe-list__icon lazyload' src='{{ asset 'icons/spotify.svg' }}' alt='Spotify icon'>
    </div>
    <span class='c-subscribe-list__name'>Spotify</span>
  </a>
</li>

The only thing you need to add is the href value. So, instead of the #, add your Spotify podcast URL.

If you want to show other links, you can remove the u-hidden class from the li element. On the other hand, if you want to hide any currently visible link, you can add the same class to the ‘li’ element.

Remove Subscribe Form

To remove the subscribe form and keep the membership enabled, open the partials/hero.hbs theme file using a code editor and remove lines from 11 to 13.

Remove Home Hero

If you want to completely remove the Hero section, open index.hbs theme file using a code editor and remove line 4 ({{> hero }}).


Pages

Manage pages for Homepage, Blog, and Contact.

Homepage Podcasts

The theme is designed to list only the posts with the podcast tag on the home page. So, to show any post on the home page, add the podcast tag to it.

Hue Ghost CMS Theme Homepage Podcasts section

Show All Posts on the Homepage

If you want to use the theme like a normal blog and show all the blog posts on the homepage, not just the posts tagged with the podcast tag, you can do the following:

In case you want to show only the Featured posts on the homepage, you can change line 10 to be filter: featured:true and then upload the routes.yaml file.

Removing Other Podcasting Functionality

  • Remove the E01 numbers by removing line 20 from the partials/post-card.hbs file.
  • Change the Latest Episodes homepage text from the index.hbs file line 9
  • To remove the Hero podcast services icons, open the partials/hero.hbs theme file using a code editor and remove line 9 ({{> subscribe-list }}).

Blog Page

The theme is designed to list posts with the blog tag on the /blog page. So, to show any post on the blog page, add the blog to it.

Hue Ghost CMS Theme Blog page

To add the blog link to the site navigation.

  • Check out the Navigation section for more information about how to add a new link.
  • In the URL field, set it to blog like the following example.
Blog page navigation

Contact Page

To create the Contact page:

  1. Create a new Page and give it a title, like “Contact”.
  2. Add your content and the contact form code using Formspree as a service. Please check the code example below.
  3. Publish the page.
  4. To add the page to the navigation, please check the Navigation section above.
<form action="https://formspree.io/your@email.com" method="POST">
  <input type="text" name="name" placeholder="Name">
  <input type="email" name="_replyto" placeholder="Email">
  <textarea name='message' placeholder="Message"></textarea>
  <input class='c-btn' type="submit" value="Send">
</form>

For more information, check out How to Add a Contact Form to Your Ghost Blog.


RSS Feed URL

Ghost automatically produces a custom RSS feed URL for every tag. So, you will have a Feed URL for posts with the blog tag and posts with the podcast tag.

Podcast RSS Feed URL

For the podcast tag, you can access it under /tag/podcast/rss/ like the theme demo aspirethemes.com/tag/podcast/rss

Blog RSS Feed URL

For the blog tag, you can access it under /tag/blog/rss/ like the theme demo aspirethemes.com/tag/blog/rss


Dark Mode

The dark mode is automatically activated based on the Operating System mode. Also, the visitor can switch between dark and light mode from the header button.

Disable Dark Mode

To disable Dark Mode, do the following steps.

  • Make sure that you run the Theme Development mode.
  • After you run gulp, open the assets/sass/settings/__all.scss theme file using a code editor and remove line 8 (@import 'colors-dark';)

Disable Light Mode

To disable the Light Mode and make Dark Mode the default, do the following steps.

  • Make sure that you run the Theme Development mode.
  • After you run gulp, open the assets/sass/settings/__all.scss theme file using a code editor and remove line 7 (@import 'colors';)
  • Open the assets/sass/settings/_colors-dark.scss theme file and replace the file content with the following code.
:root {
  --color-brand:   #0071e3;
  --color-white:   #FFFFFF;
  --color-dark:    #010101;
  --color-text:    #FFFFFF;
  --color-gray:    #E5EFF5;
  --color-error:   #ED5F74;
  --color-success: #1BA672;
  --color-border:  #383B40;

  --bg-color: #1F2023;
  --bg-gray: #27292D;
  --bg-white: var(--color-white);
  --bg-transparent: rgba(31, 32, 35, .7);
  --bg-gradient: linear-gradient(111deg, rgba(215, 239, 244, 0), rgb(203, 235, 242));

  --image-shadow: 8px 8px 0 rgba(1, 1, 1, .1);

  --bg-code-block:     #F6F9FC;
  --bg-code-inline:    var(--bg-gray);
  --color-code-inline: var(--color-text);
}

Remove the Header Dark Mode Switch Button

If you want to remove the header dark mode switch button. Open the partials/header.hbs theme file using a code editor and remove lines from 26 to 31.

Add Different Logo Images for Light and Dark Modes

Add the Logo Files to the Theme

In your theme, add two different logo files inside the /assets folder, one for light mode and the other for the dark mode. Please name each file as follows:

  • light-logo.png to be visible for light mode.
  • dark-logo.png to be visible for dark mode.

Change header.hbs file

Open the partials/header.hbs theme file using a code editor and replace lines from 4 to 12 with the following code snippet.

<a href='{{ @site.url }}' class='c-logo'>
  <span class='u-hidden-visually'>{{ @site.title }}</span>
</a>

Add Custom CSS Code

Using Ghost Code Injection admin tool, add the following CSS code to the Site Header section.

<style>
  :root {
    --logo-image: url('/assets/light-logo.png');
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-user-color-scheme]) {
      --logo-image: url('/assets/dark-logo.png');
    }
  }

  [data-user-color-scheme='dark'] {
    --logo-image: url('/assets/dark-logo.png');
  }

  .c-logo {
    max-width: 72px;
    height: 72px;
    display: block;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-image: var(--logo-image);
  }
</style>

Click Save.

Logo Notes

  • You might want to change the logo width and height by changing the value of 72px to match your logo preference and to get the best result.
  • If the logo image has a large white space around it, trim that space with a photo editing app for better results.
  • You will probably need to remove the browser cache for things to take effect.
  • This way will ignore the logo uploaded from the Ghost admin and the theme now will use the logos located in the theme.

Add Different Hero Image for Light and Dark Modes

Add the Image Files to the Theme

In your theme, add two different image files inside the /assets folder, one for light mode and the other for the dark mode. Please name each file as follows:

  • light-hero.png to be visible for light mode.
  • dark-hero.png to be visible for dark mode.

Change hero.hbs file

Open the partials/hero.hbs theme file and replace lines from 18 to 22 with the following code snippet.

<div class='o-grid__col o-grid__col--4-4-s o-grid__col--2-4-m'>
  <div class='c-hero-image'></div>
</div>

Add Custom CSS Code

Using Ghost Code Injection admin tool, add the following CSS code to the Site Header section.

<style>
  :root {
    --hero-image: url('/assets/light-hero.png');
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-user-color-scheme]) {
      --hero-image: url('/assets/dark-hero.png');
    }
  }

  [data-user-color-scheme='dark'] {
    --hero-image: url('/assets/dark-hero.png');
  }

  .c-hero-image {
    max-width: 350px;
    height: 350px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-image: var(--hero-image);
  }
</style>

Hero Image Note

  • You might want to change the image max-width and height by changing the value of 350px to match your image preference and to get the best result.
  • You will probably need to remove the browser cache for things to take effect.
  • This way will ignore the image uploaded from the Ghost admin and the theme now will use the images located in the theme.

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.

Like Header Navigation, you can add the footer navigation from the SECONDARY NAVIGATION at section Settings → Navigation page.


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. That’s it. Go and test your search now.

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 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,published_at,feature_image";

Instead of.

var url = site_url + "/ghost/api/v4/content/posts/?key=" + search_api_key + "&limit=all&fields=id,title,url,published_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.


Embed Podcasts

I don’t use a custom player for podcasts, but you can embed the podcast player code in a post.

To insert the podcast player into the Ghost editor, you need to get the EMBED CODE for that podcast and then add it as an HTML card.

To add the EMBED CODE to the editor, click on the + button and choose the HTML card.

Ghost HTML CARD

Then paste the code into the editor field and save your post.

Podcast Embed Code

Comments

The theme supports comments from Disqus, Commento, and CommentBox.

If you display comments for logged in readers only, they will need to login/register into the comment system again. As you know, Ghost has no comment system, and these are third-party tools that are not integrated with and not part of Ghost.

For questions or issues about the commenting systems here, please contact their authors or check out their documentation.

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 33).

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!

Autoload Disqus

If you want to autoload Disqus without clicking the Comments button, open the partials/disqus.hbs theme file using a code editor and replace the file content with the following code.

<div id='disqus_thread'></div>
<script>
  var disqus_shortname = 'aspirethemes-demos'; // required: replace `aspirethemes-demos` with your Disqus shortname

  // DON'T EDIT BELOW THIS LINE
  var disqus_config = function () {
    this.page.url ='{{url absolute="true"}}'
    this.page.identifier = 'ghost-{{comment_id}}';
  };

  var d = document, s = d.createElement('script');

  s.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';

  s.setAttribute('data-timestamp', +new Date());
  (d.head || d.body).appendChild(s);
</script>

CommentBox

To enable CommentBox as a comments system, open post.hbs file and replace line 33 replace with {{> commentbox}}.

The next step is to create a CommentBox account. From the dashboard, create a new project by filling your site information. You will then receive a Project ID.

Copy that Project ID, open the partials/commentbox.hbs theme file using a code editor and replace the my-project-id value with it. That’s it.

Commento

To enable Commento as a comments system, open the post.hbs theme file using a code editor and replace line 33 with {{> commento}}.

The next step is to create a Commento account and register your domain with it.


Posts Per Page

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

"config": {
  "posts_per_page": 6
}

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


If other posts share the same tags, related posts will be visible at the bottom of a post.


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/social-icons.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 and show them in the footer social media section.

Ghost CMS Theme Social Accounts

In the partials/social-icons.hbs file, you can add other social media links. For example, you can find an example for Instagram, it will look like this.

<li class='c-social-icons__item'>
  <a href='#' aria-label='Instagram' rel='noopener'>
    <span class='c-social-icons__icon' data-icon='ei-sc-instagram' data-size='s'></span>
  </a>
  </li>

The code above contains the icon code which you can find in the below list, and the social media link (a) within a list element (li).

To add your Instagram URL, replace your Instagram full URL with the link href value (#). If your Instagram URL is:

https://www.instagram.com/ghost/

Then the new code will be:

<li class='c-social-icons__item'>
  <a href='https://www.instagram.com/ghost/' aria-label='Instagram' rel='noopener'>
    <span class='c-social-icons__icon' data-icon='ei-sc-instagram' data-size='s'></span>
  </a>
</li>

If you want to completely remove Instagram, you can delete the code block, the li, a, and the icon.

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

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 data-icon='ei-sc-facebook' data-size='s'></span>

GitHub

<span data-icon='ei-sc-github' data-size='s'></span>

Instagram

<span data-icon='ei-sc-instagram' data-size='s'></span>

LinkedIn

<span data-icon='ei-sc-linkedin' data-size='s'></span>

Odnoklassniki

<span data-icon='ei-sc-odnoklassniki' data-size='s'></span>

Pinterest

<span data-icon='ei-sc-pinterest' data-size='s'></span>

Skype

<span data-icon='ei-sc-skype' data-size='s'></span>

SoundCloud

<span data-icon='ei-sc-soundcloud' data-size='s'></span>

Telegram

<span data-icon='ei-sc-telegram' data-size='s'></span>

Tumblr

<span data-icon='ei-sc-tumblr' data-size='s'></span>

Twitter

<span data-icon='ei-sc-twitter' data-size='s'></span>

Vimeo

<span data-icon='ei-sc-vimeo' data-size='s'></span>

VK

<span data-icon='ei-sc-vk' data-size='s'></span>

Youtube

<span data-icon='ei-sc-youtube' data-size='s'></span>

Languages

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

Theme Translation

Hue Ghost i18n and comes with Arabic, German, Italian, Spanish, French Finnish, Portuguese Dutch, Turkish and Danish translations.

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.

  • ar for Arabic
  • 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
| |____ar.json
| |____da.json
| |____de.json
| |____du.json
| |____en.json
| |____es.json
| |____fi.json
| |____fr.json
| |____it.json
| |____pt.json
| |____tr.json

For example, the German translation file looks like this:

{
  "Loading": "Beladung",
  "Load More": "Mehr Artikel",

  "Latest Episodes": "Latest Episodes",
  "Featured Post": "Featured Artikel",
  "Page Not Found": "Seite nicht gefunden",
  "Load Comments": "Bemerkungen",
  "You might also like": "Sie könnten daran interessiert sein",
  "Authors": "Autoren",
  "Published with {ghostLink} & {themeLink}": "Veröffentlicht mit {ghostLink} & {themeLink}",

  "Share on Twitter": "Auf Twitter teilen",
  "Share on Facebook": "Auf Facebook teilen",
  "Share on LinkedIn": "Auf LinkedIn teilen",
  "Share on Pinterest": "Auf Pinterest teilen",
  "Share via Email": "Teilen Sie per E-Mail",
  "Copy link": "Link kopieren",
  "Link copied to clipboard": "Link in die Zwischenablage kopiert",

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

  "Paid": "Bezahlt",
  "Members": "Mitglieder",
  "Public": "Öffentlichkeit",

  "Account": "Konto",
  "Log in": "Einloggen",
  "Log out": "Ausloggen",
  "Continue": "Fortsetzen",
  "Subscribe": "Abonnieren",
  "Subscribe Now": "Abonniere jetzt",
  "Your email address": "Deine E-Mail-Adresse",
  "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 page is for paying subscribers only": "Diese Seite ist nur für zahlende Abonnenten",
  "This page is for subscribers only": "Dieser Seite ist nur für Abonnenten",

  "Join the newsletter to receive the latest updates in your inbox.": "Treten Sie dem Newsletter bei, um die neuesten Updates in Ihrem Posteingang zu erhalten",

  "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 in to 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!",
  "Your subscription will expire on": "Ihr Abonnement läuft am ab",
  "Your plan": "Dein Plan",
  "Card": "Karte",
  "Expires": "Läuft ab",
  "Next bill date": "Nächstes Rechnungsdatum",
  "Edit billing info": "ERechnungsinformationen bearbeiten",
  "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 ("Loade More") and a right value ("Mehr Artikel").

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.

RTL

RTL means right to left. Turning on RTL makes the theme readable for languages written from right to left, like Arabic or Hebrew.

To enable the RTL option, open the partials/head.hbs theme file using a code editor and change line 10 to {{> compiled/inline-css-rtl }}.

Save the file and upload the theme to your Ghost blog.


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;
}
```

This will produce the following gray look:

Hue 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:

Hue Ghost Theme Syntax Highlighting with prismjs

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

Prism

Hue 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.

Hue Ghost Theme Syntax Highlighting Code Injection PHP Prism

Theme Deploy with GitHub Actions

Hue 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.

Hue 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.


Changing Colors with CSS Variables

Using Code Injection, you can change the theme colors for the light and dark modes with CSS Variables.

For a list of available theme variables, check:

  • Light theme: assets/sass/settings/colors.scss
  • Dark theme: assets/sass/settings/colors-dark.scss

If you want for example to change the theme brand color. You can copy the color variable and add it inside each code block like the following example.

<style>
  :root {
    --color-brand: red;
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-user-color-scheme]) {
      --color-brand: green;
    }
  }

  [data-user-color-scheme='dark'] {
    --color-brand: green;
  }
</style>

Notice that we duplicated the variable for dark mode in two blocks.

The color brand is used for buttons, links color, and links hover. In the above example, we changed the color for the light mode to be red and to green for the dark mode. You can override this for any other variable.

If, for example, you want to add another color that is not available in the available theme variables and wants to add another style to a new element. You can create a new variable and give it a name and value.

We can extend the previous example to add a new color for the logo color and assign that variable to the .c-logo__link class.

<style>
  :root {
    --color-brand: red;
    --color-logo: blue;
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-user-color-scheme]) {
      --color-brand: green;
      --color-logo: gold;
    }
  }

  [data-user-color-scheme='dark'] {
    --color-brand: green;
    --color-logo: gold;
  }

  .c-logo__link {
    color: var(--color-logo);
  }
</style>

The logo will then have a blue color for the light mode and gold color for the dark mode.


Customize Home Post Card Image Height

If you want to customize the homepage post card images height, you can use the following CSS code in Ghost admin Code Injection.

The theme default value is 100%. You can change this value to match your preference.

.c-post-card__media {
  padding-top: 100%;
}

The full code in Code Injection would be:

<style>
  .c-post-card__media {
    padding-top: 100%;
  }
</style>

Customize Home Hero Image Size

If you want to change the home hero image size size, you can use the following code.

<style>
  .c-hero-image {
    max-height: 40vh;
  }
</style>

The default value is 40vh. Increase or decrease this value to match your preference. For example, to make it bigger, let it be.

<style>
  .c-hero-image {
    max-height: 50vh;
  }
</style>

Customize Logo Size

If you are using an image as a logo (instead of the site name) and want to change the logo size, use the following code in Code Injection.

<style>
  .c-logo__img {
    max-height: 32px;
  }
</style>

The default value is 32px, so you can increase this value to match your preference.

If the logo image has a large white space around it, trim that space with a photo editing app for better results.


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

Use one of the following three options to create a zip file ready to upload to your Ghost website.

➊ 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 the theme folder to view the context menu. Then, click the Compress option.

Ghost theme zip on macOS

➋ Using the command line

zip -r hue.zip hue -x '*.git*' '*node_modules*' '*bower_components*'

This command will exclude the node_modules and bower_components in case you are running gulp. And in case you are using Git, it will remove the .git folder.

➌ Using Gulp

Use the gulp zip command if you are running gulp.


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