Back to Documentations

Ubud Documentation

Theme version: 1.0.9 — 24 August 2022 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 ubud, you will find the ubud.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 ubud.zip theme file.
  5. Once uploaded, click Activate now to activate Ubud.

Upload the routes.yaml File (⚑ Required)

The routes.yaml is required for the following reasons:

  • Homepage content
  • Blog page
  • Archive page

To upload the file, follow these steps:

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

Or watch the following video for installation.

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.

Homepage 404: Page Not Found

After uploading the routes.yaml file, the homepage will return 404 Page Not Found.

That’s fine. Move on to the next step and set up the Homepage.


Homepage

The homepage will show a list of content sections.

  • Your content and image from a custom Ghost Page
  • Featured posts, if they exist
  • Recent three posts
  • All Posts → link to the blog page
  • Subscription box

Homepage Content

In Ghost admin, create a new Page.

From the Page settings, ensure that the Page URL setting is home.

Ubud Ghost Theme Custom Homepage Setting

Add your content, add a featured image, and publish the page.

The page title will not be visible on the website; only the content and the image will be. However, you can name it Home or any preferred name to make it visible from the dashboard.

If you don’t want to upload an image, you can leave it empty, and the theme will only show the page content on the homepage, like the following example.

Ubud Ghost Theme homepage

Now, go to your website homepage, and your content is visible using the theme homepage default layout style.

Watch the following video for the homepage setup.

Homepage Metadata Note

Due to a Ghost limitation not exposing the custom homepage data, the homepage Metadata information will be coming from the admin General and Branding settings.

  • From the site admin Settings > General, you can set up the Title & description.
  • From the site admin Settings > Design > Brand, you can set up the Publication cover. You can upload the same image as the homepage featured image if you have already uploaded one.

Metadata is helpful for Search Engine Optimization and sharing your website on social media sites to have a nice-looking preview.


The Twitter card and Facebook card meta settings under Settings > General are helpful if you want to customize the look for these specific sites.


It might take some time for the social media site to fetch the new image and to see the changes; give it some time. You can also use a tool like Twitter Card validator for testing.

Homepage Default Style

The theme file for the home default style is partials/home/style-image-left.hbs if you want to make any changes.

Ubud Home Image Default

Homepage Default Style Image Size

The image size is 540px wide.

When uploading the Featured image, try to upload an image with a double size to look sharp in retina displays. The 540px wide size is the one that is visible on the screen. But behind the scenes, the theme will crop the image to be 1080px wide if the uploaded image is broader than that. Again, I use this method so the image looks good on retina screens.

Homepage Image Right Style

The theme file for the home image right style is partials/home/style-image-right.hbs if you want to make any changes.

Ubud Home Image Right

To activate the Image Right style:

  1. Go to your Ghost admin Settings > Design > Site design > Homepage
  2. Choose Image Right from the Homepage layout style option
  3. Click Save

Homepage Image Right Style Image Size

The image size is 540px wide.

When uploading the Featured image, try to upload an image with a double size to look sharp on retina displays.

The 540px wide size is the one that is visible on the screen. But behind the scenes, the theme will crop the image to be 1080px wide if the uploaded image is broader than that.

Again, I use this method so the image looks good on retina screens.

Homepage Image Circle Style

The theme file for the home image circle style is partials/home/style-image-circle.hbs if you want to make any changes.

Ubud Home Image Circle

To activate the Image Circle style:

  1. Go to your Ghost admin Settings > Design > Site design > Homepage
  2. Choose Image Circle Small/Medium/Large/xLarge from the Homepage layout style option
  3. Click Save

Homepage Image Circle Style Image Sizes

The image circle style comes with four different image sizes.

  • Small → 96px × 96px
  • Medium → 128px × 128px
  • Large → 192px × 192px
  • xLarge → 256px × 256px

When uploading the Featured image, try to upload an image with a double size to look sharp on retina displays.

The previous sizes are the ones that are visible on the screens. But behind the scenes, the theme will use the actual image size.

Again, I use this method so the image looks good on retina screens.

  • Small → 192px × 192px
  • Medium → 256px × 256px
  • Large → 384px × 384px
  • xLarge → 512px × 512px

The theme and Ghost will do the image crop and generate those sizes when you upload an image. I want to give you an overview of the dimensions.

Ubud Home Image Circle Sizes

Homepage Image Center Style

The theme file for the home image center style is partials/home/style-image-center.hbs if you want to make any changes.

Ubud Home Image Center

To activate the Image Center style:

  1. Go to your Ghost admin Settings > Design > Site design > Homepage
  2. Choose Image Center from the Homepage layout style option
  3. Click Save

Homepage Image Center Style Image Size

The image size is 731px wide.

When uploading the Featured image, try to upload an image with a double size to look sharp on retina displays.

The 731px wide size is the one that is visible on the screen. But behind the scenes, the theme will crop the image to be 1462px wide if the uploaded image is broader than that.

Again, I use this method so the image looks good on retina screens.

Homepage Image Wide Style

The theme file for the home image center style is partials/home/style-image-wide.hbs if you want to make any changes.

Ubud Home Image Wide

To activate the Image Wide style:

  1. Go to your Ghost admin Settings > Design > Site design > Homepage
  2. Choose Image Wide from the Homepage layout style option
  3. Click Save

Homepage Image Wide Style Image Size

The image size is 1120px × 630px.

When uploading the Featured image, try to upload an image with a double size to look sharp on retina displays.

The 1120px × 630px size is the one that is visible on the screen. But behind the scenes, the theme will crop the image to be 2240px wide if the uploaded image is larger than that.

Again, I use this method so the image looks good on retina screens.

Homepage Image Full Style

The theme file for the home image full style is partials/home/home-image-full.hbs if you want to make any changes.

Ubud Home Image Full

To activate the Image Full style:

  1. Go to your Ghost admin Settings > Design > Site design > Homepage
  2. Choose Image Full from the Homepage layout style option
  3. Click Save

Homepage Image Full Style Image Size

The wider the image, the better. An image height of 676px will be perfect.

To control how many Featured or Recent posts to show, go to your Ghost admin Settings > Design > Site design > Homepage

You will find two input settings:

  • Number of featured posts default value is all, showing all featured posts.
  • Number of recent posts default value is 3, which will only show the recent three posts.

Input values you can use:

  1. Number, 1, 2 or 3
  2. all to show all posts
  3. none to show nothing
Homepage Number of Featured and Recent Posts Settings

To change the Featured Posts title, open the partials/home/featured-posts.hbs theme file using a code editor and change it in line 8.

To change the Recent Posts title, open the partials/home/recent-posts.hbs theme file and change it in line 8.

Homepage Styles and File Names

Below are the homepage styles and theme file names for a quick overview.

  • Homepage Default Style → partials/home/style-image-left.hbs
  • Homepage Image Right Style → partials/home/style-image-right.hbs
  • Homepage Image Circle Style → partials/home/style-image-circle.hbs
  • Homepage Image Center Style → partials/home/style-image-center.hbs
  • Homepage Image Wide Style → partials/home/style-image-wide.hbs
  • Homepage Image Full Style → partials/home/style-image-full

If you set the Recent Posts setting value to all or none, the All Posts → button will be invisible.

Another option to hide is to add the following CSS code into the Ghost admin Code Injection Site Header.

<style>
  .home-template .c-pagination { display: none; }
</style>

Changing Colors

In this section, you will learn about changing the website Accent color and how to change the theme color scheme with CSS variables, and more examples of color schemes.

Set Accent Color

You can change the theme Accent color from the Ghost admin. Ubud uses the Accent color throughout the theme in buttons, header Membership link text, and content links hover interaction.

Change the Accent color from the admin Settings > Design > Brand > Accent color.

Ubud demo Accent color is: 5869DA (the dark orange color).

Ghost Accent Color Setting

Changing Colors with CSS Variables

You can use Code Injection to change the other theme colors with CSS Variables.

The theme file assets/sass/settings/colors.scss contains the theme default color variables. They are exactly as the following.

:root {
  --color-text-primary:   #181818;
  --color-text-secondary: #646F82;

  --color-white:   #FFFFFF;
  --color-error:   #CC3C64;
  --color-success: #07815C;
  --color-border:  #ECECEC;
  --color-border-info:     #3366FF;
  --color-border-success:  #52BD95;
  --color-border-warning:  #FFB020;
  --color-border-danger:   #D14343;

  --background-primary:   #FFFFFF;
  --background-secondary: #F6F6F6;
  --background-info:      #F3F6FF;
  --background-success:   #ECFDF5;
  --background-warning:   #FFFAF2;
  --background-danger:    #FDF4F4;

  --background-hero: var(--background-secondary);
}

Watch the following video for an overview of the color scheme feature and how to use it.

Theme Colors Explained

It might seem complicated if you are not a technical person, but once you change one and get an instant result, you will get and feel it.

You can try the ready-made nine color schemes below.

:root {
  // Primary text is the main text color for site content.
  --color-text-primary: #181818;

  // Secondary text is the color of elements like post date, footer nav, input placeholder, content captions for images and galley, for example, and author information block icons and metadata.
  --color-text-secondary: #687385;

  // White color used for buttons with the brand colors as a background.
  --color-white: #FFFFFF;

  // Color error is used for the error message that comes when something wrong happens while subscribing.
  --color-error: #CC3C64;

  // Color success used for the success message comes when something wrong happens while subscribing.
  --color-success: #07815C;

  // Color border is used for borders separating each post card in the homepage, for example, and used as a color for the form input border.
  --color-border: #ECECEC;

  // Color border info is used for the Note component border
  --color-border-info: #3366FF;

  // Color border success is used for the Note component border
  --color-border-success: #52BD95;

  // Color border warning is used for the Note component border
  --color-border-warning: #FFB020;

  // Color border danger is used for the Note component border
  --color-border-danger: #D14343;

  // Primary background is the website background. Also, used for the subscribe box icon color.
  --background-primary: #FFFFFF;

  // Secondary background used for the homepage content background, subscribe box, subscribe plans, author information block, and comments section.
  --background-secondary: #F6F6F6;

  // Background info danger is used for the Note (info) component background
  --background-info:      #F3F6FF;

  // Background success danger is used for the Note (success) component background
  --background-success:   #ECFDF5;

  // Background warning danger is used for the Note (warning) component background
  --background-warning:   #FFFAF2;

  // Background danger danger is used for the Note (danger) component background
  --background-danger:    #FDF4F4;

  // The hero background will inherit the secondary background from the above `--background-secondary`. I set a specific color variable to it if you want to put a unique color or make it the same as the website background.
  --background-hero: var(--background-secondary);
}

Color Scheme Examples

Below, you can find nine accessible color scheme examples, which you can use in two steps.

  1. Evey color scheme has an accent color, set it first then;
  2. Copy and past the scheme code into the Ghost admin Code Injection Site Header section

All the color schemes are accessible colors for better reading and accessibility experience.

➊ Dark

Accent color → DC514D

<style>
  :root {
    --color-text-primary:   #FFFFFF;
    --color-text-secondary: #9BAAC1;

    --color-white:   #FFF;
    --color-error:   #FF6347;
    --color-success: #00CF80;
    --color-border:  #292622;
    --color-border-info:    #3366FF;
    --color-border-success: #52BD95;
    --color-border-warning: #FFB020;
    --color-border-danger:  #D14343;

    --background-primary: #000;
    --background-secondary: #241F21;
    --background-info:      #5656A5;
    --background-success:   #2E6953;
    --background-warning:   #725C17;
    --background-danger:    #AE3131;

    --background-hero: var(--background-secondary);
  }
</style>
Ubud Ghost CMS Theme Color Scheme Dark

➋ Monza

Accent color → D6001C

<style>
  :root {
    --color-text-primary:   #D6001C;
    --color-text-secondary: #D6001C;

    --color-white:   #FFFFFF;
    --color-error:   #96281B;
    --color-success: #134D13;
    --color-border:  #D6001C;
    --color-border-info:    #3366FF;
    --color-border-success: #52BD95;
    --color-border-warning: #FFB020;
    --color-border-danger:  #D14343;

    --background-primary: #FFFFFF;
    --background-secondary: #FFF3CC;
    --background-info:      #F3F6FF;
    --background-success:   #ECFDF5;
    --background-warning:   #FFFAF2;
    --background-danger:    #FDF4F4;

    --background-hero: var(--background-primary);
  }
</style>
Ubud Ghost CMS Theme Color Scheme Monza

➌ Soft Peach

Accent color → 905656

<style>
  :root {
    --color-text-primary:   #241616;
    --color-text-secondary: #412727;

    --color-white:   #FFFFFF;
    --color-error:   #96281B;
    --color-success: #134D13;
    --color-border:  #e9dbdb;
    --color-border-info:    #3366FF;
    --color-border-success: #52BD95;
    --color-border-warning: #FFB020;
    --color-border-danger:  #D14343;

    --background-primary: #F6F0F0;
    --background-secondary: #f2e9e9;
    --background-info:      #F3F6FF;
    --background-success:   #ECFDF5;
    --background-warning:   #FFFAF2;
    --background-danger:    #FDF4F4;

    --background-hero: var(--background-primary);
  }
</style>
Ubud Ghost CMS Theme Color Soft Peach

➍ Cinnamon

Accent color → 805b00

<style>
  :root {
    --color-text-primary:   #000;
    --color-text-secondary: #374c6d;

    --color-white:   #FFFFFF;
    --color-error:   #D91E18;
    --color-success: #205E3B;
    --color-border:  #807D67;
    --color-border-info:    #3366FF;
    --color-border-success: #52BD95;
    --color-border-warning: #FFB020;
    --color-border-danger:  #D14343;

    --background-primary: #F4F6EF;
    --background-secondary: #e4e6e0;
    --background-info:      #F3F6FF;
    --background-success:   #ECFDF5;
    --background-warning:   #FFFAF2;
    --background-danger:    #FDF4F4;

    --background-hero: var(--background-secondary);
  }
</style>
Ubud Ghost CMS Theme Color Scheme Cinnamon

➎ Bright Gray

Accent color → 373f48

<style>
  :root {
    --color-text-primary:   #3C434C;
    --color-text-secondary: #647180;

    --color-white:   #FFFFFF;
    --color-error:   #B22222;
    --color-success: #20603C;
    --color-border:  #DFE3E9;
    --color-border-info:    #3366FF;
    --color-border-success: #52BD95;
    --color-border-warning: #FFB020;
    --color-border-danger:  #D14343;

    --background-primary: #FFFFFF;
    --background-secondary: #E7EBF0;
    --background-info:      #F3F6FF;
    --background-success:   #ECFDF5;
    --background-warning:   #FFFAF2;
    --background-danger:    #FDF4F4;

    --background-hero: var(--background-secondary);
  }
</style>
Ubud Ghost CMS Theme Color Scheme Bright Gray

➏ Iron

Accent color → 000000

<style>
  :root {
    --color-text-primary:   #212121;
    --color-text-secondary: #404040;

    --color-white:   #FFFFFF;
    --color-error:   #B50000;
    --color-success: #20603C;
    --color-border:  #bdbec2;
    --color-border-info:    #3366FF;
    --color-border-success: #52BD95;
    --color-border-warning: #FFB020;
    --color-border-danger:  #D14343;

    --background-primary: #d6d7d9;
    --background-secondary: #f2f2f3;
    --background-info:      #F3F6FF;
    --background-success:   #ECFDF5;
    --background-warning:   #FFFAF2;
    --background-danger:    #FDF4F4;

    --background-hero: var(--background-secondary);
  }
</style>
Ubud Ghost CMS Theme Color Scheme Iron

➐ Linen

Accent color → b95d0e

<style>
  :root {
    --color-text-primary:   #000;
    --color-text-secondary: #374c6d;

    --color-white:   #FFFFFF;
    --color-error:   #923026;
    --color-success: #205E3B;
    --color-border:  #ece3dc;
    --color-border-info:    #3366FF;
    --color-border-success: #52BD95;
    --color-border-warning: #FFB020;
    --color-border-danger:  #D14343;

    --background-primary: #FFFFFF;
    --background-secondary: #FCF3ED;
    --background-info:      #F3F6FF;
    --background-success:   #ECFDF5;
    --background-warning:   #FFFAF2;
    --background-danger:    #FDF4F4;

    --background-hero: var(--background-secondary);
  }
</style>
Ubud Ghost CMS Theme Color Scheme Linen

➑ Turbo

Accent color → 000000

<style>
  :root {
    --color-text-primary:   #000000;
    --color-text-secondary: #000000;

    --color-white:   #FFFFFF;
    --color-error:   #5C0819;
    --color-success: #005031;
    --color-border:  #000000;
    --color-border-info:    #3366FF;
    --color-border-success: #52BD95;
    --color-border-warning: #FFB020;
    --color-border-danger:  #D14343;

    --background-primary: #FEE900;
    --background-secondary: #fff14a;
    --background-info:      #F3F6FF;
    --background-success:   #ECFDF5;
    --background-warning:   #FFFAF2;
    --background-danger:    #FDF4F4;

    --background-hero: var(--background-primary);
  }
</style>
Ubud Ghost CMS Theme Color Scheme Turbo

➒ Pampas

Accent color → c31118

<style>
  :root {
    --color-text-primary:   #292a2c;
    --color-text-secondary: #65605E;

    --color-white:   #FFFFFF;
    --color-error:   #5C0819;
    --color-success: #005031;
    --color-border:  #b2b2b2;
    --color-border-info:    #3366FF;
    --color-border-success: #52BD95;
    --color-border-warning: #FFB020;
    --color-border-danger:  #D14343;

    --background-primary: #F6F4F2;
    --background-secondary: #eeedeb;
    --background-info:      #F3F6FF;
    --background-success:   #ECFDF5;
    --background-warning:   #FFFAF2;
    --background-danger:    #FDF4F4;

    --background-hero: var(--background-primary);
  }
</style>
Ubud Ghost CMS Theme Color Scheme Pampas

If you have any schemes you would like to share, please let me know :)

Content links have the same color as text and turn to the brand color when you hover over it.

To change the color from text color to the color brand, add the following CSS code into the Ghost admin Code Injection Site Header.

<style>
  .c-content a:not([class]) {
    color: var(--ghost-accent-color);
  }
</style>

Color Tools

The following are some online websites and tools to help with color inspiration. Please make sure you choose an accessible color scheme; this is important for readers.

Change Color of Specific Elements

If, for example, you want to add a color that’s not in the available theme variables or 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 logo HTML element class .c-logo__link.

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

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

The logo will then have a blue color.


Members / Subscriptions

Ubud has different interface components for membership features.

  • Log in and Membership links in the Header
  • Homepage subscription boxes
  • A post subscription box
  • Call to action section on the post page to encourage visitors to subscribe if the post is for members only

If a member is already logged-in, the subscription forms will be hidden.

Remove Membership Components from the Theme

  1. Go to your Ghost admin Settings > Membership > Subscription access
  2. Select Nobody
  3. Click Save

Add the following CSS code into the Ghost admin Code Injection Site Header.

<style>
  .c-header .is-membership { display: none; }
</style>

Click Save.

This will also remove the Account link, visible if logged in.

Embed Subscribe Form in a 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.

<div class='u-bg-gray u-border-radius u-p-32'>
  <form data-members-form="signup" class="c-subscribe-form is-membership ">
    <div class="c-form-group">
      <label for="home-content-subscribe-form-email" class="u-hidden-visually">Your email address</label>
      <input type="email" name="email" class="c-form-group__input" id="home-content-subscribe-form-email" placeholder="Your email address" required="" data-members-email="">
      <button type="submit" value="Subscribe" class="c-btn c-form-group__btn">Subscribe</button>
    </div>

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

The result.

Subscribe Form Embed

Demo.

To embed the homepage subscribe form, use the following code.

<section class="c-subscribe">
  <div class="c-subscribe__content">
    <h2 class="c-subscribe__heading u-type-500 u-mb-8">Ubud Newsletter</h2>
    <p class="u-mb-16">Join the newsletter to receive the latest updates in your inbox.</p>
    <form data-members-form="signup" class="c-subscribe-form is-membership ">
      <div class="c-form-group">
        <label for="subscribe-box-email" class="u-hidden-visually">Your email address</label>
        <input type="email" name="email" class="c-form-group__input" id="subscribe-box-email" placeholder="Your email address" required="" data-members-email="">
        <button type="submit" value="Subscribe" class="c-btn c-form-group__btn">Subscribe</button>
      </div>

      <div class="c-alert c-alert--success">Please check your inbox and click the link to confirm your subscription.</div>
      <div class="c-alert c-alert--invalid">Please enter a valid email address!</div>
      <div class="c-alert c-alert--error">An error occurred, please try again later.</div>
    </form>
  </div>
  <div class="c-subscribe__icon">
    <svg height="300px" width="300px" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" x="0px" y="0px" viewBox="0 0 100 100"><g transform="translate(0,-952.36218)"><path style="text-indent:0;text-transform:none;direction:ltr;block-progression:tb;baseline-shift:baseline;color:#000000;enable-background:accumulate;" d="m 16.999997,973.36216 c -4.4386,0 -7.9999997,3.7333 -7.9999997,8.2188 l 0,41.53124 c 0,4.4854 3.5613997,8.25 7.9999997,8.25 l 66.000006,0 c 4.4386,0 8,-3.7646 8,-8.25 l 0,-41.53124 c 0,-4.4855 -3.5614,-8.2188 -8,-8.2188 l -66.000005,0 z m 0,4 66.000006,0 c 0.5919,0 1.1508,0.1705 1.6562,0.4062 L 52.468798,1008.331 c -1.4774,1.4026 -3.3951,1.4027 -4.875,0 l -32.25,-30.56264 c 0.5054,-0.2357 1.0643,-0.4062 1.6562,-0.4062 z m -3.9375,3.75 22.7813,21.59384 -22.4063,22.375 c -0.2806,-0.5827 -0.4375,-1.2497 -0.4375,-1.9688 l 0,-41.53124 c 0,-0.1624 0.047,-0.3123 0.062,-0.4688 z m 73.875006,0 c 0.016,0.1565 0.062,0.3064 0.062,0.4688 l 0,41.53124 c 0,0.7087 -0.1644,1.3609 -0.4375,1.9375 l -22.343705,-22.375 22.718705,-21.56254 z m -25.625005,24.34384 21.875005,21.9062 c -0.063,0 -0.1241,0 -0.1875,0 l -66.000005,0 c -0.053,0 -0.104,0 -0.1562,0 l 21.9062,-21.875 6.0938,5.75 c 2.9023,2.7512 7.4733,2.7551 10.375,0 l 6.0937,-5.7812 z" fill-opacity="1" stroke="none" visibility="visible" display="inline"></path></g></svg>
  </div>
</section>

The result.

Subscribe Form Embed

Demo.

To save time each time you add a new form, you can create it as a snippet.

You may be asking how I got the form HTML code above? You can copy it from your blog or the theme demo source code. You can do this by opening your browser DevTools, selecting the form element, and copying 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.

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 using Ghost Pro, please contact the Ghost team. If you use any self-hosting provider, please contact 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.


You can add, edit, delete, and reorder the 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 in the label field as you’d like it to appear on your menu.

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 satisfied with your page configurations, click the Save button.

Add a Hyphen (-) followed by a space before the navigation Label to add a dropdown menu.

Ghost dropdown navigation menu

In this example, Contact will be the parent item with Blog and Archive as child items.

Like Header Navigation, you can add the footer navigation links from the Ghost admin Settings → Navigation > SECONDARY NAVIGATION.

Social Media Icons

The theme file for the navigation social media icon links is partials/social-icons.hbs.

Ghost supports adding Facebook and Twitter profile URLs from the admin panel. Go to General > Social accounts and add your URLs, and the theme will automatically add them in the site navigation.

Ghost CMS Theme Social Accounts

Ubud supports adding Instagram, YouTube, LinkedIn, and Telegram URLs. Go to Settings > Design > Site-wide.

Ubud Ghost Theme Social Media Accounts Settings

If you want to add new social media links not available in the theme or Ghost settings shown above, you can do that in the partials/social-icons.hbs file. You will find the icon’s code that comes with the theme in the Available Social Media Icons section.

For example, to add a new social line for Pinterest, your code will be like:

<li class='c-nav__item c-nav__item--social'>
  <a href='#'>
    <span class='c-nav__item__icon' data-icon='ei-sc-pinterest' data-size='s'></span>
    <span class='u-hidden-visually'>Pinterest</span>
  </a>
</li>

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

Next, replace your Pinterest full URL with the link href value. If your Pinterest URL is:

https://www.pinterest.com/pinterest/

Then the final code will be:

<li class='c-nav__item c-nav__item--social'>
  <a href='https://www.pinterest.com/pinterest/'>
    <span class='c-nav__item__icon' data-icon='ei-sc-pinterest' data-size='s'></span>
    <span class='u-hidden-visually'>Pinterest</span>
  </a>
</li>

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

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

GitHub

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

Instagram

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

LinkedIn

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

Odnoklassniki

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

Pinterest

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

Skype

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

SoundCloud

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

Telegram

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

Tumblr

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

Twitter

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

Vimeo

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

VK

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

Youtube

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

Open the partials/footer.hbs theme file using a code editor and add the following code after line 5.

<ul class='c-footer-nav o-plain-list'>
  {{> social-icons }}
</ul>

Next, open the partials/header.hbs theme file and remove line 25 ({{> social-icons }}).

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


Ubud uses the Ghost Native Search.

  1. Go to your Ghost admin Settings > Design > Site design > Site-wide
  2. Toggle the Show search option off
  3. Click Save

Pages

Manage pages for Archive, Blog, and Contact.

Archive Page

The Archive page shows all posts organized by month and also contains all website tags.

The archive page theme file is archive.hbs.

To add the archive item to the site navigation, add it as a navigation item. Make sure to set the destination URL to /archive/ like the following screenshot.

Ubud Ghost Theme Archive Navigation Item
Ubud Archive Page

Blog Page

The blog page includes your recent ten posts with a load more bottom to load more.

You can change the number of posts from the Posts Per Page setting.

The blog page theme file is index.hbs.

To add the blog item to the site navigation, add it as a navigation item. Make sure to set the destination URL to /blog/ like the following screenshot.

Ubud Ghost Theme Blog Navigation Item
Ubud Blog Page

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.
<form action="https://formspree.io/your@email.com" method="POST">
  <input type="text" name="name" placeholder="Name"><br>
  <input type="email" name="_replyto" placeholder="Email"><br>
  <textarea name='message' placeholder="Message"></textarea><br>
  <input class='c-btn c-btn--action' type="submit" value="Send">
</form>

Check out How to Add a Contact Form to Your Ghost Blog for more information.


Languages

Ubud comes in many languages already. But if you’d like to add another one, you’ll be able to do that too.

Theme Translation

Ubud supports 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
  • en for English
  • es for Spanish
  • fi for Finnish
  • fr for French
  • it for Italian
  • nl for Dutch
  • 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/ theme folder:

|____locales
| |____ar.json
| |____da.json
| |____de.json
| |____en.json
| |____es.json
| |____fi.json
| |____fr.json
| |____it.json
| |____nl.json
| |____pt.json
| |____tr.json

For example, the German translation file looks like this:

{
  "Skip to content": "Zum Inhalt springen",
  "Table of Contents": "Inhaltsverzeichnis",

  "Loading": "Wird geladen",
  "More Posts ↓": "Weitere Artikel ↓",
  "All Posts →": "Alle Artikel →",

  "Recent Posts": "kürzliche Artikel",
  "Featured Posts": "Beliebte Beiträge",
  "Related Posts": "zusammenhängende Posts",
  "Page Not Found": "Seite nicht gefunden",
  "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": "Per E-Mail teilen",
  "Copy link": "Link kopieren",
  "Link copied to clipboard": "Link in die Zwischenablage kopiert",

  "Archive": "Archiv",
  "Tags": "Stichworte",
  "1 min read": "1 minuten gelesen",
  "% min read": "% minuten gelesen",

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

  "Account": "Konto",
  "Log in": "Einloggen",
  "Subscribe": "Abonnieren",
  "Membership": "Mitgliedschaft",
  "Your email address": "Deine E-Mail-Adresse",
  "{siteTitle} Newsletter": "{siteTitle} Newsletter",
  "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 content is for Members": "Dieser Inhalt ist für Mitglieder",
  "This content is for Paid Members": "Dieser Inhalt ist für bezahlte Mitglieder",
  "This content is for Subscribers on the ": "This content is for Subscribers on the ",
  "Upgrade your account": "Aktualisieren Sie Ihr Konto",
  "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"
}

Each line consists of a left key ("Loading") and a right value ("Wird geladen").

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

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

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.

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

Multiple Languages Support

The theme supports Ghost translations for different languages, which means if you set the site language to French, some parts of the theme will change to French, for example, button labels.

On the other hand, having multiple languages on one website is not supported out of the box in Ghost, so the theme. This guide by Ghost explains how to configure multiple languages. I have not tried it, but it might be a good starting point.


Comments

The theme supports comments from Ghost Native Comments, Disqus, Commento, and CommentBox.

Ghost Native Comments

The theme comes with Ghost Native Comments integration. You can turn the comments on from your Ghost admin Settings > Membership > Commenting.

Learn more about Ghost comments.

Ghost developer documentation for comments.

The theme file for Ghost comments partials/comments/ghost.hbs.

Disqus

To enable Disqus as a comments system, do the following two steps:

Open the post.hbs theme file using a code editor and replace line 45 with the following line.

{{> comments/disqus}}

Open the partials/comments/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, copy and paste the following CSS code into the Ghost admin Code Injection Site Header.

<style>
  #disqus_recommendations, #disqus_thread { display: none; }
</style>

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 disable Tracking and Affiliate Links from your Disqus account.

Check out Keegan Leary’s blog post about this issue at https://www.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!

CommentBox

To enable CommentBox as a comments system, open the post.hbs theme file using a code editor and replace line 45 with the following line.

{{> comments/commentbox}}

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

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

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

Commento

To enable Commento as a comments system, open the post.hbs theme file using a code editor and replace line 45 with the following line.

{{> comments/commento}}

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

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


Typography Drop Caps

The theme comes with different styles of typography drop caps. It will apply to the first letter of the first word on a given paragraph.

To add a drop cap style to a paragraph.

  1. Add an HTML card to your Post or Page content editor
  2. In that HTML card, add a <p> </p> HTML element with the Drop Cap CSS class. For example, <p class='u-drop-cap'> </p>. Check below for the available classes for each style
  3. Add your paragraph text whith that <p> </p> HTML element
Ubud Ghost Theme Typography Dropcap HTML card

There are currently four styles available.

➊ Small Drop Cap

  • CSS class → u-drop-cap
  • Example ↓
<p class='u-drop-cap'>TEXT HERE</p>

The result.

Ubud Ghost Theme Typography Dropcap

➋ Large Drop Cap

  • CSS class → u-drop-cap-large
  • Example ↓
<p class='u-drop-cap-large'>TEXT HERE</p>

The result.

Ubud Ghost Theme Typography Dropcap Large

➌ Block/Small Drop Cap

  • CSS class → u-drop-cap--block-small
  • Example ↓
<p class='u-drop-cap--block-small'>TEXT HERE</p>

The result.

Ubud Ghost Theme Typography Dropcap Block Small

➍ Block/Large Drop Cap

  • CSS class → u-drop-cap--block-large
  • Example ↓
<p class='u-drop-cap--block-large'>TEXT HERE</p>

The result.

Ubud Ghost Theme Typography Dropcap Block Large

To save time each time you create a new Drop Cap, you can create it as a snippet.


Content Notes

Use Content Notes to show content in a different style. Notes are helpful if you want to get your reader’s attention to important information within your article.

Ubud Content Notes

To add a Note section.

  1. Add an HTML card to your Post or Page content editor
  2. In that HTML card, add a <div> </div> HTML element with the Note CSS class. For example, <div class='c-note'> </div>. Check below for the available classes for each style
  3. You can then add an inner HTML element, for example, a paragraph, or a list item. Check below for an example
Ubud Ghost Theme Content Note HTML card

There are currently five styles available.

➊ Default Style

  • CSS class → c-note
  • Example ↓
<div class='c-note'>
  <p>ADD YOUR TEXT HERE</p>
</div>

The result.

Ubud Ghost Theme Content Note Dafault HTML card Style

➋ Info Style

  • CSS class → c-note c-note--info
  • Example ↓
<div class='c-note c-note--info'>
  <p>ADD YOUR TEXT HERE</p>
</div>

The result.

Ubud Ghost Theme Content Note Info HTML card Style

➌ Success Style

  • CSS class → c-note c-note--success
  • Example ↓
<div class='c-note c-note--success'>
  <p>ADD YOUR TEXT HERE</p>
</div>

The result.

Ubud Ghost Theme Content Note Success HTML card Style

➍ Warning Style

  • CSS class → c-note c-note--warning
  • Example ↓
<div class='c-note c-note--warning'>
  <p>ADD YOUR TEXT HERE</p>
</div>

The result.

Ubud Ghost Theme Content Note Warning HTML card Style

➎ Danger Style

  • CSS class → c-note c-note--danger
  • Example ↓
<div class='c-note c-note--danger'>
  <p>ADD YOUR TEXT HERE</p>
</div>

The result.

Ubud Ghost Theme Content Note Warning HTML card Style

To save time each time you create a new Note, you can create it as a snippet.


Table of Contents

Add a table of contents to your posts and pages automatically.

The table of contents section will show the post headings h2 and h3 supported by the Ghost editor. If none of these headings exist in post content, the table of contents section will be hidden.

Ubud Table of Contents

Activate on All Posts & Pages

The table of contents block is invisible by default. Go to Settings > Design > Site design > Post to activate it. You have two options:

  1. Show table of contents on all posts
  2. Show table of contents on all pages
Ubud Table of Contents activation

Activate on Individual Posts & Pages

Make sure that show the table of content on all posts and pages options are not active.

Create a new Internal tag from the admin Tags page and set the Name to: #table-of-content

Ubud Table of Contents Hash Tag

You can now assign the #table-of-content tag to a post or a page, and the table of contents will only be visible to that post or page.

Ubud Table of Contents Post Settings

Posts Per Page

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

"config": {
  "posts_per_page": 10
}

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

Note

This will not apply to the homepage but for the Blog page, Author, and Tag pages. For the homepage, checkout Homepage Number of Featured and Recent Posts.


Related posts section will be visible at the bottom of a post if other posts share the same tags as the current post.


RSS Feed URL

Since Ubud uses /blog/ URL for posts, you can access the RSS feed at site.com/blog/rss/ instead of site.com/rss/. For example, ubud.aspirethemes.com/blog/rss/.


Google Analytics

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


Update Favicon

You can change the favicon from the Ghost admin Settings > Design > Site design > Brand > Publication icon.


Social Sharing Icons

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


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:

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

Ubud Ghost Theme Syntax Highlighting with prismjs

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

Prism

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

Ubud Ghost Theme Syntax Highlighting Code Injection PHP Prism

Theme Deploy with GitHub Actions

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

Ubud documentation Ghost CMS Theme GitHub Actions

I have written about this in 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 software by Ghost and works with any Ghost install, whether you self-host Ghost or use Ghost Pro.


Footnotes

Ghost has limited support for footnotes, which means it doesn’t support footnotes outside of the editor Markdown card. So, if your article content will all be in Markdown, this will work fine for you.

For creating a footnote, check out the Markdown Guide – Footnotes for more information about the syntax. You can check out how the theme renders this example in the demo. So, in your editor, you need to add a new Markdown card and then add your footnote inside.

The theme will render what the editor can do; the theme has no built-in footnotes support but Ghost. Check out this theme demo example.

Check out this Forum discussion for more information and probably some ideas and workarounds. Someone suggests bigfoot, and another one adds it manually.

I have not done any work to support footnotes beyond the basic Ghost Markdown implementation, so I’m afraid I can’t give any advice here.


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.

Checkout How to use Code Injection Ghost gude for more information.


Blockquote Styles

Copy the code of any examples below into the Ghost admin Code Injection Site Header, then click Save

➊ Example One

Ubud Ghost Theme Blockquote Example Two
<style>
  .c-content blockquote {
    padding: 64px 40px;
    font-size: 24px;
    line-height: 40px;
    text-align: center;
    position: relative;
    font-family: Georgia,serif;
    border-left: 0;
    border: .25px solid var(--ghost-accent-color);
  }

  .c-content blockquote:before,
  .c-content blockquote:after {
    position: absolute;
    font-size: 48px;
    color: var(--ghost-accent-color);
  }

  .c-content blockquote:before {
    content: '“';
    top: 24px;
    left: 24px;
  }

  .c-content blockquote:after {
    content: '”';
    bottom: 24px;
    right: 24px;
    line-height: 0;
  }
</style>

➋ Example Two

Ubud Ghost Theme Blockquote Example Two
<style>
  .c-content blockquote {
    padding: 24px 0;
    font-size: 24px;
    line-height: 40px;
    border-left: 0;
    border-top: 8px solid var(--ghost-accent-color);
    box-shadow: 0 1px 0 0 var(--ghost-accent-color);
    -webkit-box-shadow: 0 1px 0 0 var(--ghost-accent-color);
  }
</style>

Changing Theme Typeface

Ubud is using one font, Inter.

The theme loads Inter using Google Fonts in the theme partials/fonts.hbs file. It is then assigned as a CSS Variable and other system fonts as a backup, as in the following example.

:root {
  --font-family:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
}

To change to any other font, you need to include the font on your theme or use Code Injection Site Header if you use Google Fonts.

For example, if you want to use the Roboto font from Google Fonts. Your code in Code Injection might be like this.

<link href='https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap' rel='stylesheet'>

<style>
  :root {
    --font-family: 'Roboto', sans-serif;
  }
</style>

You might find the following posts helpful as well:


Loading Custom Typeface

I assume you have the font files and the initial @font-face CSS code for loading the font. Something similar to the following code.

@font-face {
  font-family: 'Atyp';
  src: local('Atyp Text Regular'), local('Atyp-Text-Regular'),
    url('AtypText-Regular.woff2') format('woff2'),
    url('AtypText-Regular.woff') format('woff'),
    url('AtypText-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

Create a new folder in the theme under /assets and name it fonts, for example, then copy your font files there.

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

In Ghost admin Code Injection, add your @font-face code with the new font files path wrapped in the <style> element.

<style>
  @font-face {
    font-family: 'Atyp';
    src: local('/assets/fonts/Atyp Text Regular'), local('Atyp-Text-Regular'),
        url('/assets/fonts/AtypText-Regular.woff2') format('woff2'),
        url('/assets/fonts/AtypText-Regular.woff') format('woff'),
        url('/assets/fonts/AtypText-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
  }
</style>

This should load the fonts. Then you can use the font and do your styling for the body and so on.


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: 40px;
  }
</style>

The default value is 40px, 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. Open and edit that file using a code editor.

If you just want to remove the Published with Ghost… part, copy and paste the following code into the Ghost admin Code Injection Site Footer.

<script>
    var footer_copy = document.querySelector('.c-footer-copy'),
    footer_copy_visible_part = footer_copy.innerText.split('-')[0];
    footer_copy.innerText = footer_copy_visible_part;
</script>

AMP

Read more about AMP at Google AMP + Ghost

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


Remove Dates

To remove the dates from the theme homepage and listing pages, add the following CSS code into Ghost admin Code Injection Site Header.

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

  .c-post-card {
    grid-template-areas: 'content content content content content content content content content media media media';
  }

  .c-post-card--no-image {
    grid-template-areas: 'content content content content content content content content content content content content';
  }
</style>

To only remove the date and keep the Public, Members and Paid labeles, use the following.

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

To remove date from the post page, use the following.

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

Remove Author Elements

To remove the author elements from the post page, add the following CSS code into Ghost admin Code Injection Site Header.

<style>
.c-card-author,
.c-post-header__author_name,
.c-post-header__author_media { display: none; }
</style>

This will remove the author name, image and the author bio under each post.


Show Primary Tag Instead of ‘Public’, ‘Members’ and ‘Paid’ Labels on Post Card

Open the partials/home/recent-posts.hbs theme file using a code editor and change line 3 to:

{{#get 'posts' limit=@custom.number_of_recent_posts include='tags'}}

In partials/home/featured-posts.hbs file, change line 3 to:

{{#get 'posts' filter='featured:true' limit=@custom.number_of_featured_posts include='tags'}}

In partials/post-card.hbs file, replace lines 13, 14, 15 with:

{{ tags separator=', ' limit='1' }}

If you want to add more tags, change the limit to a higher number.

To make the tag clickable and make it visible for members and non-members, add the following CSS code into the Ghost admin Code Injection Site Header.

<style>
  .c-post-card__meta { z-index: 2; }
  .c-post-card__visibility { display:block;visibility: visible; }
</style>

Open the theme routes.yaml file using a code editor and replace lines from 18 to 21 with the following.

collections:
  /:
    permalink: /{slug}/
    filter: featured:true
  /blog/:
    permalink: /{slug}/
    template: index
    filter: featured:false

Save and Upload the routes.yaml file to your website.


Remove Post Featured Image

If you want to remove the featured image from showing on the single post page, copy and paste the following CSS code into the Ghost admin Code Injection Site Header.

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

This will apply to a Post or a Page.


Not uploading a featured image will do this. But if you already uploaded images and want to keep them for the article page and social media previews when you share your post, add the following CSS code into Ghost admin Code Injection Site Header.

<style>
  .c-post-card__media { display: none; }
  .c-post-card { grid-template-areas: "meta meta meta content content content content content content content content content"; }
</style>

Make Post Card Featured Image Bigger

The Just Looking website use a more prominent image size for the homepage featured image. To do the same, add the following CSS code into the Ghost admin Code Injection Site Header.

<style>
  .c-post-card {
    grid-template-areas: 'meta meta content content content content content media media media media media';
  }
</style>

Post Card Featured Image Ratio

The post card featured image might look cropped from the outline; to disable this, change the image object-fit CSS value to contain by copying the following CSS code into the Ghost admin Code Injection Site Header.

<style>
  .c-post-card__image { object-fit: contain; }
</style>

You may then want to remove the gray background.

<style>
  .c-post-card__image-wrap { background-color: var(--background-primary); }
</style>

Open Post Links in a New Tab

To open the post links in a new tab, add the following script in the Code Injection Site Footer section.

<script>
  document.querySelectorAll('.c-post a').forEach(function (e) {
    if (e.hostname !== window.location.hostname) {
      e.target = '_blank';
    }
  });
</script>

Thanks, Taylor.N, for sharing this snippet!


Add Shadow to Home Content

If you like the shadow on Iain Broome, or Steve Schlafman websites, copy and paste the following CSS code into the Ghost admin Code Injection Site Header.

<style>
  .c-home,
  .c-home-right,
  .c-home-circle,
  .c-home-center,
  .c-home-wide-content,
  .c-home-full-content { box-shadow: 0 20px 40px -10px rgb(0 0 0 / 20%); }
</style>

Theme Development

This section is for developers only, and I assume you know what you are doing.

If you need to add custom CSS code, I highly recommend using Code Injection 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.

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.

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. It is used as an Internal CSS in the theme partials/head.hbs.

This file is generated from the assets/css/style-min.css file, which was generated by Gulp.

If you are working with Gulp, you should avoid editing these files. Instead, do customizations in assets/sass for CSS or in assets/js/app.js JavaScript. This way, you can ensure 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 setup is and which package versions I use, take a look at the following:

$ node -v
v14.17.0

$ npm -v
7.16.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 Monterey / M1 Chip.

You don’t have to have the exact environment setup, so that’s fine if your current setup works.


Zip Theme Files

You can compress it as a standard folder like 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

Theme Update

You may be wondering how I can update my theme to the latest 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.


Support

Have any questions? I’m here to help.

Contact Ahmad
Ahmad Ajmi