Skip to content

Ubud Ghost Theme — Documentation

Theme version: 1.1.1 — 28 August 2023 Changelog

Theme Editing & Tools

Edit the theme files mentioned here with a code editor. I recommend Visual Studio Code or Sublime Text. 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're looking for Ghost hosting, I recommend Ghost(Pro).

Table of Contents


Theme Installation

To begin, unzip the downloaded package by double-clicking it on a Mac or by right-clicking and selecting “Extract All” on Windows.

Inside the new ubud folder, 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 Site > Design & branding.
  4. Click Customize > Change theme.
  5. Click Upload theme and select the ubud.zip theme file.
  6. 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 Advanced > Labs.
  4. Click Open > Beta features.
  5. From the Routes section, click Upload routes YAML button.
  6. 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

Ubud Ghost Theme Custom Homepage Setting

➀ In Ghost admin, create a new Page.

➁ In Page settings, set the Page URL as home.

Ubud Ghost Theme Custom Homepage Setting

➂ Add your content, Excerpt, upload your feature image.

Above the title in the Ghost editor, click the + Add feature image to upload your image.

Ubud Ghost Theme Custom Homepage feature Image

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

➃ Click Publish.

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

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

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 feature 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 & branding > 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 & branding > 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 & branding > 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 & branding > 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 & branding > 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 & branding > 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 or any number you want to include
  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

Homepage Replace the Content Subscribe Form With a Button

You may want to replace the homepage content subscribe form with a button that goes another page or website.

Open the theme file for the homepage style you are using. Replace the folowing line of code for the subscribe form, which will be similar to:

{{> home/subscribe-form }}

With the following line of code.

<a href='#/portal/signup' class='c-btn c-btn--full' style='color:#fff; text-decoration:none;'>Subscribe</a>

Notice that I used the #/portal/signup as a value to the Portal. You can change this value to another website or internal website page.

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

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>

Homepage Remove the Bottom Subscribe Box

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

<style>
  .home-template .c-subscribe { 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.

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

  --color-white:   #FFFFFF;

  --background-primary:   #FFFFFF;
  --background-secondary: #F6F6F6;

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

  // 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;

  // 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-border:  #292622;

    --background-primary: #000;
    --background-secondary: #241F21;

--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-border:  #D6001C;

    --background-primary: #FFFFFF;
    --background-secondary: #FFF3CC;

    --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-border:  #e9dbdb;

    --background-primary: #F6F0F0;
    --background-secondary: #f2e9e9;

    --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-border:  #807D67;

    --background-primary: #F4F6EF;
    --background-secondary: #e4e6e0;

    --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-border:  #DFE3E9;

    --background-primary: #FFFFFF;
    --background-secondary: #E7EBF0;

    --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-border:  #bdbec2;

    --background-primary: #d6d7d9;
    --background-secondary: #f2f2f3;

    --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-border:  #ece3dc;

    --background-primary: #FFFFFF;
    --background-secondary: #FCF3ED;

    --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-border:  #000000;

    --background-primary: #FEE900;
    --background-secondary: #fff14a;

    --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-border:  #b2b2b2;

    --background-primary: #F6F4F2;
    --background-secondary: #eeedeb;

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

If you want to disable membership from your website, you can do the following from the website admin. After doing this, all the theme/website membership elements like header links and forms will be removed.

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

If you want to keep membership enabled and the forms visible but only remove the header links.

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.

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

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

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

Click Save.

Remove Subscribe Form from the Homepage Content

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

<style>
  [class^='c-home'] .c-subscribe-form { display: none; }
</style>

Click Save.

Remove Subscribe Form from the Homepage Bottom

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

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

Click Save.

Remove Subscribe Form from the Post Page

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

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

Click Save.

Remove Ghost Portal / The Bottom Right Button

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

Remove Ghost Portal

Change Subscribe Box Text

You can change the subscribe box text from the partial/subscribe-box.hbs theme file. Open the file using a code editor.

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

Add Name to the Subscribe Form

Open the /partials/subscribe-form.hbs file using a code editor, and add the following lines after line 10.

<label for='{{ nameLabel }}' class='u-hidden-visually'></label>
<input type='text' name='name' class='c-form-group__input' id='{{ nameLabel }}' placeholder='Your name' required data-members-name>

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

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, ensure 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 you use 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 get in touch with the Ghost team. If you use any self-hosting provider, please get in touch with 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 > Site > Navigation > Primary.

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 > Site > Navigation > Secondary.

Social Media Icons

Ghost supports adding Facebook and Twitter profile URLs from the admin panel. Go to Settings > 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, Mastodon, Discord, 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. Click Publish to 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 or other parts of the website like Comments and Search labels. It is also not possible to translate the newsletter emails your subscribers receive. These are core Ghost components and not part of the theme layer; we can’t control them.

I suggest reaching out to the Ghost 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.

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


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.


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.


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 to display per page from the theme package.json file. Open that file using a code editor and change the posts_per_page value from 10 to a number.

"config": {
  "posts_per_page": 10
}

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

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

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

If your website is private, the RSS URL will not function properly. Once your website is made public, the URL will work as expected.


Publication icon

You can change the favicon from the Ghost admin Settings > Design & branding > 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

The theme 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 by adding the Prism autoloader script, which will automatically load the languages you need. T do this, add the following script to the website admin Code Injection (Site Footer).

<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.28.0/plugins/autoloader/prism-autoloader.min.js" integrity="sha512-fTl/qcO1VgvKtOMApX2PdZzkziyr2stM65GYPLGuYMnuMm1z2JLJG6XVU7C/mR+E7xBUqCivykuhlzfqxXBXbg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

Click Save.


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 ghost theme — 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 is 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 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.

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.

Check out How to use Code Injection Ghost guide 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 before uploading 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>

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 Feature Image

If you want to remove the feature 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.


Remove Homepage Feature Image

Not uploading a feature 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 Feature Image Bigger

The Just Looking website use a more prominent image size for the homepage feature 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 Feature Image Ratio

The post card feature 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 website, 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>

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

Have any questions? Contact Ahmad

Use code TODAY for 10% off