Skip to content
Download the Ghost Themes Bundle for only $199 — Use BUNDLE code for 10% discount 🔥

Hue Documentation - Ghost

Current Version: 1.0.2 - 02 July 2020 Changelogs →



Theme Installation

The first step is to unzip the downloaded package and you will find the actual theme inside besides a documentation file. Then do the following steps to upload the theme to your blog.

  • Log in to the admin section of your Ghost blog yourblog.com/ghost.
  • Select Design from the left-hand side of your admin area and go to the INSTALLED THEMES section.
  • Click on the Upload a theme green button.
  • An upload box will open, then choose the theme file (hue.zip).
  • Once uploaded. Click on Activate now button to activate the theme immediately or Close if you want to activate it later.

Create a new Content API Key

In order for the Search to work, we need to generate a new Content API Key using the following steps.

From Ghost admin, click Integrations from the sidebar menu, then click + add custom integration.

Add new Ghost Custom integrations

Then, give the new integration a name, for example, Search and click Create.

Name for the Ghost Custom integrations

Now, a new Key is created, hover over it and the new Copy button will appear, click on it to copy the Key to the clipboard.

Copy Ghost Custom integrations Content API Key

Next, click Code injection from the sidebar menu and add the following code to the Blog Header box after replacing the XXXX value with your API KEY.

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

To be like:

Inject Ghost Custom integrations Content API Key

Click Save.


Upload the routes.yaml file

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:

  • Go to the Ghost admin Labs settings page (/#/settings/labs)
  • Scroll down to the Routes section and click the Upload routes YAML button.
  • Select and upload the routes.yaml file in the theme directory.

Upload a routes file in Ghost


Home Hero

home hero

The hero section shows the following components:

  • Site Publication cover
  • Site description
  • Subscribtion form. This form will be visible once the Members / Subscription is enabled.
  • Subscribe list with icons to show and link to different podcast services.

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

For site description:

  • Settings > General > PUBLICATION INFO > Title & description

For Publication cover:

  • Settings > General > PUBLICATION IDENTITY > Publication cover

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>

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 file. 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' target='_blank' rel='noopener noreferrer'>
    <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 Home Hero Section

If you want to completly remove the Hero section, open index.hbs file and remove line 4 ({{> hero }}).


Home Podcasts

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

Home 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 in the homepage not just the posts tagged with podcast, you can do the following:

Also, you can remove the E01 numbers by removing line 20 from the partials/post-card.hbs file.

On the homepage, to change the Latest Episodes text, you can do this from the index.hbs file line 9


Blog Page

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

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


Members / Subscription

Subscribers can be enabled via a checkbox on the Labs page (Labs > MEMBERS (BETA)), in your Ghost admin panel:

enable subscribers

Once enabled, different parts of the theme will appear:

  • Login In and Sign Up buttons in the header.
  • Homepage Hero section subscription form.
  • Call to action section in Post page to encourage visitors to subscribe if the post is set to Members only.

Edit Plans Features

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

Subscription plans in Hue


Remove “Log In” And “Sign Up” From Nav Bar

To remove the “Log In” and “Sign up” from the navigation menu. Open the partials/header.hbs file and remove lines from 19 to 27.


For more information about Members, connecting Stripe and setting the package price, I highly recommend checking the official Ghost documentation.


Dark Mode

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


Remove the Header Dark Mode Switch Button

If you want to remove the header dark mode switch button. Open the partials/header.hbs file and remove lines from 28 to 33;


Disable the Automatic Dark Mode

To disable the Automatic Dark Mode switch.

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

You can add, edit, delete and reorder menu links on your Ghost blog from the Navigation section in the admin area located at ghost/#/settings/design.

navigation menu

To include a static page on your navigation menu. First, type the name of the page as you’d like it to appear on your menu in the label field.

label field

Next, click on the URL field of the menu item and we can find that the blog URL is already auto-populate for us. We will need to add the page slug after the final /. Once satisfied with our page configurations. Clicking the blue Save button will add the page to the navigation menu.


For the search to work, please make sure to Create a new Content API Key.

The theme uses ghostHunter. Search is done for the post title and the content.

The supported languages in addition to English are Russian, French, Spanish, Germany, Portuguese, Italian, Finnish, Dutch and Danish.


Embed Podcasts

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


RTL

RTL means (Right to Left), so the theme can show content in languages that are written from right to left like Arabic or Hebrew.

To enable the RTL version, open the default.hbs file and change line 10 to be {{> compiled/inline-css-rtl }}.

Hue Ghost Theme Activate RTL

If you want the Dark Mode version in RTL, change line 10 to be {{> compiled/inline-css-rtl }}

Hue Ghost Theme Activate RTL Dark Mode

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


Contact Page

To create the Contact page:

  • Create a new Page and call it Contact for example.
  • Add your content and the contact form code using FORMSPREE as a service. Please check the code example below.
  • Publish the page.
  • 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 c-btn--small c-btn--active' type="submit" value="Send">
</form>

For more information, check the How to Add a Contact Form to Your Ghost Blog blog post.


Disqus Comments

Hue Theme comes with Disqus comments enabled.

Open partials/disqus.hbs file. Change the aspirethemes-demos value for 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';

That’s all you need to setup Disqus from the theme side. If you get any issue that comments are unable to load. First, make sure you have registered your website with Disqus (Step 1)

And also check Disqus troubleshooting guide if you still have issues.

Disable Disqus

If you want to disable Disqus comments. Open the post.hbs file and comment or delete the line contains the {{> disqus}} text (line 33).

Autoload Disqus

If you want to autoload Disqus without clicking the Comments button, open the partials/disqus.hbs file 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>
<noscript>Please enable JavaScript to view the <a href='https://disqus.com/?ref_noscript' rel='nofollow'>comments powered by Disqus.</a></noscript>

CommentBox Comments

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

The next step is to create a commentbox account and then from the dashboard, create a new project by filling your site information and then you will receive a Project ID.

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


Commento Comments

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

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


Posts Per Page

You can control how many posts to show per page from the package.json file like this:

"config": {
  "posts_per_page": 6
}

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


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:

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 wrapp between ```css and ``` as following:

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

Will produce the following colored look:

Hue Ghost Theme Syntax Highlighting with prismjs

To add an inline code, you can wrap the text between two backticks ` `, for example:

This inline code example `absolute="true"`

Will produce the following look:

Hue Ghost Theme Syntax Highlighting with prismjs


Hue shipped with Prism.js, a lightweight, robust, and elegant syntax highlighter.

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

You can add and support 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>

Add the script to Ghost Code Injection Site Footer section. Click Save button.

Hue Ghost Theme Syntax Highlighting Code Injection PHP Prism


Related posts will be visible on the single post in case there are similar posts sharing the same tags.

Enabling the Public API required.


Google Analytics

To integrate Google Analytics. I would recommend reading Google Analytics integration steps by Ghost.


Responsive Tables

Responsive tables required and essential for adding tabular content and allows 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 media links 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 within the footer social media section.

social-accounts

For using other social accounts, the theme is using Evil Icons to provide a very simple and clean icons. 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>

To edit or update other existed and static social links, for example, the Instagram code block:

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

The code above contains the ICON code from the above list, the social media link (a) within a list element (li).

Next, replace your Instagram full URL with the link href value so if your Instagram URL is:

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

the new code will be:

<li class='c-social-icons__item'>
  <a href='https://www.instagram.com/ghost/' aria-label='Instagram' target='_blank' rel='noopener noreferrer'>
    <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 all the code block, the li, a, and the icon.


Update Favicon

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

Update favicon


Theme Translation

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

To use another available language than English, go to Admin > General > PUBLICATION INFO> Publication Language and enter the Language Code Reference.

  • de for Germany
  • it for Italian
  • es for Spanish
  • fr for French
  • fi for Finnish
  • pt for Portuguese
  • du for Dutch
  • da for Danish

Ghost Publication Language Setting

Add New Language

To add a new language, you can follow the steps in the Official Ghost Documentation.

Edit Translation

To improve or edit a translation in a specific available language. You can open the language file under locales folder:

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

For example the Germany translation file will look like:

{
  "Loading": "Beladung",
  "Loade 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",
  "Sign Up": "Anmelden",
  "Continue": "Fortsetzen",
  "Subscribe": "Abonnieren",
  "Subscribe Now": "Abonniere jetzt",
  "Your email": "Deine E-Mail-Adresse",
  "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.",

  "You've successfully subscribed to {siteTitle}": "Sie haben {siteTitle} erfolgreich abonniert.",
  "Great! Next, complete checkout for full access to {siteTitle}": "Toll! Schließen Sie als Nächstes die Prüfung ab, um vollen Zugriff auf {siteTitle} zu erhalten.",
  "Welcome back! You've successfully signed in.": "Willkommen zurück! Sie haben sich erfolgreich angemeldet.",
  "Success! Your account is fully activated, you now have access to all content.": "Erfolg! Ihr Konto ist vollständig aktiviert, Sie haben nun Zugriff auf alle Inhalte.",

  "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.",
  "Sign Up to {siteTitle}": "Anmelden bei {siteTitle}",
  "Get access to premium content": "Erhalten Sie Zugang zu Premium-Inhalten",

  "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 consist of a left key ("Loade More") and right value ("Mehr Artikel"). The key is a plain Englich which exist in all translation files and should not be changed. You can only change the value.

If you have suggestions to improve the current translations or added a new language. Please let me know.


Theme Deploy with GitHub Actions

Hue comes integrated with the amazing Deploy Ghost Theme Github action.

Hue GitHub Actions

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


Theme Development

If you are a developer and need to do heavy customization work. The theme is using Gulp to compile Sass and JavaScript. This improves the development flow and making it much faster.

First, make sure you have Node.js, npm, Gulp CLI, and Bower installed. 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 generate two files:

  • assets/js/app.min.js: The final main JavaScript file.
  • partials/compiled/inline-css.hbs: The final CSS file.

It’s recommended to avoid editing these files if you are working with Gulp. Instead, do customizations in assets/sass files for CSS or in assets/js/app.js for JavaScript. So, we can make sure the flow is going in the right direction and we never lost any changes.


Code Injection

Another option for customization, is to use the Ghost Code Injection settings in Ghost Admin. For a CSS example, you can use the following code to change the logo color as:

<style>
  .c-logo__link { color: #4550e5; }
</style>

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.

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 want 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 a gold color for the dark mode.


Add Different Logo Images for Light and Dark Modes

1. Add the Logo Files to the Theme

In your theme, add two different log 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.
2. Change header.hbs file

Open the partials/header.hbs theme file 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>
3. 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 {
    width: 72px;
    height: 72px;
    display: block;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-image: var(--logo-image);
  }
</style>

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.

PS: This way will ignore the logo uploaded from the Ghost admin and the theme now will use the logos located in the theme.


Customize logo size

If you are using an image as a logo instead of the site name and want to change the logo size you can use the following code.

<style>
  .c-logo__img {
    max-width: 72px;
  }
</style>

The default value is 72px, so you can increase this value to match your preference. If the loge image has a large white space around, make sure you trim that space to get good results.


To create a clean and small theme package. You can exclude different directories using the following command line:

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

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

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


👋 Support

Have any questions? I'm always here to help 😊

Contact Ahmad
Ahmad Ajmi Photo
Ahmad Ajmi