Back to Documentations

Beirut Documentation

Theme version: 1.0.2 — 24 May 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 beirut, you will find the beirut.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 beirut.zip theme file.
  5. Once uploaded, click Activate now to activate Beirut.

Upload the routes.yaml File (⚑ Required)

The routes.yaml is required for the following reasons:

  • Work page
  • Writing page

To upload the file, follow these steps:

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

Note: upload routes.yaml after uploading the theme zip

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

Do this separately after uploading your theme zip file.


Content Structure (⚑ Required)

This document part will introduce you to three essential sections:

  1. Beirut Concept to learn about the content structure
  2. Create Work and Writing Tags
  3. Organize Posts by Tags

➀ Beirut Concept

The concept behind Beirut is to organize your work and writings to show them on different pages and sections. Your work type might be creative work, photography, or any.

How does the theme separate each? Beirut uses tags to create this separation. Posts tagged with work will be in the work section, while posts tagged with writing will be in the writing section. So, each new post you create must have the work or the writing tag.

The homepage will include the introduction, work, services, clients, testimonials, and writing sections.

You will have a list of all work posts under the /work/ URL. The same goes for writing under /writing.

➁ Create Work and Writing Tags

Go to your Ghost admin Tags page and create two new tags, Work and Writing. Fill in the Name and Description for each.

Work Tag

Add the tag Name as Work and ensure the Slug is work. The Description field is optional.

Beirut Ghost Theme Work Tag

Click Save.

Writing Tag

Add the tag Name as Writing and ensure the Slug is writing. The Description field is optional.

Beirut Ghost Theme Writing Tag

Click Save.

Beirut will use the Name and Description on the Work and Writing pages.

Beirut Ghost Theme Writing Page

➂ Organize Posts by Tags

After creating your Work and Writing tags, organize your posts by giving each post a tag from the post settings.

If you have more than one tag for a post, ensure that the Work or the Writing tag is the first, as shown in the screenshot below. We call the first tag a Primary tag.

Beirut Ghost Theme Primary Tag

Don’t add Work and Witing tags in the same post; a post should have at least one but not both.

Any additional tags will be visible under the title.

Beirut Ghost Theme Post Additional Tags

Homepage

The homepage will show a list of content sections.


Homepage Introduction

Here, you can add text, images, or links.

  1. Go to your Ghost admin Settings > Design > Site design > Homepage
  2. Add your content in the Hero heading box
  3. Click Save changes
Beirut Ghost Theme Homepage Introduction

Use HTML image element to add an image, for example:

<img src='https://media0.giphy.com/media/jpbnoe3UIa8TU8LM13/200w.webp' alt='' width='32' height='32'>

The visible image size will be 32px and will be zoomed a little when you hover over it.

Or; the HTML link element to add a link:

<a href='/url'>Link</a>

If you want to add a contact link, use mailto as the following example:

<a href='mailto:ahmad@aspirethemes.com'>get in touch</a>

The following is the demo example.

Amelia Harry <img src='https://beirut-green.aspirethemes.com/content/images/size/w320/2022/01/guillaume-bleyer-Dep2HTKqGj0-unsplash-2-1.jpg' alt='' width='32' height='32'> is a Designer and Art Director based in London ● Harry began her studies in art and interior decoration at Wiesbaden School of Art <sup>2016</sup> – Now, I work as an independent designer, <a href='mailto:ahmad@aspirethemes.com'>get in touch</a>. ✌︎

Dingbat ❊

✁ ✂ ✃ ✄ ✅ ✆ ✇ ✈ ✉ ☛ ☞ ✌ ✍ ✎ ✏ ✐ ✑ ✒ ✓ ✔ ✕ ✖ ✗ ✘ ✙ ✚ ✛ ✜ ✝ ✞ ✟ ✠ ✡ ✢ ✣ ✤ ✥ ✦ ✧ ★ ✩ ✪ ✫ ✬ ✭ ✮ ✯ ✰ ✱ ✲ ✳ ✴ ✵ ✶ ✷ ✸ ✹ ✺ ✻ ✼ ✽ ✾ ✿ ❀ ❁ ❂ ❃ ❄ ❅ ❆ ❇ ❈ ❉ ❊ ❋ ● ❍ ■ ❏ ☺ ☻ ♥ ♦ ♣ ♠ • ◘ ○ ❐ ❑ ❒ ▲ ▼ ◆ ❖ ◗ ❘ ❙ ❚ ❛ ❜ ❝ ❞ → ☀ ↳ ⤷ ✌︎ ☼ 

➀ ➁ ➂ ➃ ➄ ➅ ➆ ➇ ➈ ➉
➊ ➋ ➌ ➍ ➎ ➏ ➐ ➑ ➒ ➓

Fleuron ❦

❦ ❧ ☙


Homepage Work

The Work section shows four recent posts with the Work tag.

Beirut Ghost Theme Homepage Work

To control how many Work items to show:

  1. Go to your Ghost admin Settings > Design > Site design > Homepage
  2. Type a number in the Number of work items box. Or, type none to hide the Work section
  3. Click Save changes

Homepage Services

Add a list item, call it services, tools, or whatever.

Beirut Ghost Theme Homepage Work

The Clients/Logos section is invisible by default. To show it:

  1. Go to your Ghost admin Settings > Design > Site design > Homepage
  2. Activate the Show services section option
Beirut Ghost Theme Homepage Services

Update the Services Section

Using a code editor, open the theme /partials/home/services.hbs file. You can find two columns; I called one Services and the other Technologies. Each column has a list of items underneath. Each item is added inside an HTML <li></li> element. Change, delete, update as much as you like.

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


Homepage Clients/Logos

Beirut Ghost Theme Homepage Clients/Logos

Show or Hide the Clients/Logos Section

The Clients/Logos section is invisible by default. To show it:

  1. Go to your Ghost admin Settings > Design > Site design > Homepage
  2. Activate the Show clients section option
Beirut Ghost Theme Homepage Clients/Logos

The images are stored in the theme /images/clients/ folder. So, this is where you can add your logo images.

Using a code editor, open the theme /partials/home/clients.hbs file. In this file, you can find a list of the current logo examples.

Each logo is an HTML list item.

<li>
  <img src='{{asset 'images/clients/netflix.svg'}}' alt='Netflix' class='lazyload'>
</li>

Add the logo image inside the /images/clients/ theme folder to add a new logo.

If the logo image name is ghost.png, your HTML code in the /partials/home/clients.hbs file would be:

<li>
  <img src='{{asset 'images/clients/ghost.png'}}' alt='Netflix' class='lazyload'>
</li>

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


Homepage Testimonials

Beirut Ghost Theme Homepage Testimonials

Show or Hide the Testimonials Section

The Testimonials section is invisible by default. To show it:

  1. Go to your Ghost admin Settings > Design > Site design > Homepage
  2. Activate the Show testimonials section option
Beirut Ghost Theme Homepage Testimonials Setting

Add a New Testimonial

Using a code editor, open the theme /partials/home/testimonials.hbs file. In this file, you can find two testimonials as an example, which you can update or replicate to create new ones.

Each testimonial contains:

  1. Testimonial text
  2. Testimonial author image
  3. Testimonial author name
  4. Testimonial author title
<div class='c-card-testimonial'>
  <blockquote class='c-card-testimonial__text'>A beautiful product clearly made by a passionate, experienced team.</blockquote>

  <div class='c-card-testimonial__author'>
    <figure class='c-card-testimonial__figure'>
      <img src="{{ asset '/images/testimonials/amelia.jpg' }}" class='c-card-testimonial__author__image lazyload' alt='' width='64' height='64'>
    </figure>
    <div class='c-card-testimonial__author__bio'>
      <p class='c-card-testimonial__author__name'><a href='#'>Amelia Harry</a></p>
      <p class='c-card-testimonial__author__title'>Engineer @Shopify</p>
    </div>
  </div>
</div>

You can add the testimonial quote text inside the blockquote line.

<blockquote class='c-card-testimonial__text'>This Is Where you can add your testimonial quote</blockquote>

The images are stored in the theme /images/testimonials/ folder. So, this is where you can add your testimonial author images. An image of 128px × 128px is a good size.

If the testimonials author image name is ahmad.jpg, your image HTML code in the /partials/home/testimonials.hbs file would be:

<img src="{{ asset '/images/testimonials/ahmad.jpg' }}" class='c-card-testimonial__author__image lazyload' alt='' width='64' height='64'>

You can add a link using the HTML link tag; for example, I added a link to the testimonial author in the above example.

<p class='c-card-testimonial__author__name'><a href='#'>Amelia Harry</a></p>

Make sure to replace the # with the URL you want to link.

If you don’t want to link to the author, remove the a start and closing tags; the final line would be:

<p class='c-card-testimonial__author__name'>Amelia Harry</p>

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


Homepage Writing

The Writing section shows four recent posts with the Writing tag.

Beirut Ghost Theme Homepage Work

To control how many Writing items to show:

  1. Go to your Ghost admin Settings > Design > Site design > Homepage
  2. Type a number in the Number of writing items box. Or, type none to hide the Writing section
  3. Click Save changes

Homepage Metadata Note

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.

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 from the social media site to fetch the new image and see the changes; give it some time. You can also use a tool like Twitter Card validator for testing.


Pages

Manage Work, Writing and About pages.

Work Page

The Work page shows all posts with the Work tag.

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

Check Add Work Page to Navigation for adding it to the website navigation.

Beirut Work Page

The Work page theme file is work.hbs.

Writing Page

The Writing page shows all posts with the Writing tag.

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

Check Add Writing Page to Navigation for adding it to the website navigation.

Beirut Writing Page

The Writing page theme file is writing.hbs.

About Page

  1. Create a new page from your Ghost admin
  2. Add the page Title, Content, Excerpt, and upload a featured image
  3. Open the page settings and choose About from the Template dropdown menu
Beirut About Page Template Option
Beirut About Page

The About page theme file is custom-about.hbs.


The work featured image ideal size to upload is 1184 × 790. The visible size is 592 × 395, but double it to 1184 × 790 to look sharper on retina displays.

The image aspect ratio is set to 3/2.

To change the ratio, you can do this with CSS into the Ghost admin Code Injection Site Header

  <style>
    .c-card-work__media { aspect-ratio: 3/2; }
  </style>

Change the 3/2 value to your new ratio.


Make Tags Clickable

The theme shows tags on the homepage work card and individual content pages. The tags are unclickable by default.

Beirut Ghost Theme Post Additional Tags

To make them clickable, open the following theme files using a code editor and change the autolink value from false to true (Line 15).

  • /partials/card-work.hbs
  • /partials/page-header.hbs

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


Changing Colors

You can change all your website colors from the admin settings.

Go to your website admin Settings > Design > Site design > Site-wide to show color settings.

Beirut Ghost CMS Theme Colors Settings

Colors Explained

  1. Text color primary. Main text color for site content.
  2. Text color secondary. Text color for section heading, post date, and image caption elements.
  3. Border color. Color of the border, for example, the border between the Writing list.
  4. Background color primary. The main background color.
  5. Background color secondary. For site footer, Writing list hovers and a placeholder for images before loading.

You can also set the Accent color from the admin Settings > Design > Brand > Accent color. The Accent color is only used for the content Header Card with the background set to the Accent color.

Ghost Accent Color Setting

Color Examples

Below, you can find six accessible color scheme examples.

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

Please copy the code value for each color and add it to the color settings.

➀ Green

Demo →

  1. Text color primary016450
  2. Text color secondary016450
  3. Border color6c9a8d
  4. Background color primaryecf5f2
  5. Background color secondaryd6ece5
Beirut Ghost CMS Theme Color Scheme Green

➁ Isabelline

Demo →

  1. Text color primary703288
  2. Text color secondary703288
  3. Border colord4c1d3
  4. Background color primaryf4efec
  5. Background color secondarydac9d9
Beirut Ghost CMS Theme Color Scheme Isabelline

➂ Red

Demo →

  1. Text color primaryB30000
  2. Text color secondaryB30000
  3. Border colorB30000
  4. Background color primaryFFFFFF
  5. Background color secondaryfafafa
Beirut Ghost CMS Theme Color Scheme Red

➃ Dark

Demo →

  1. Text color primaryd5caaf
  2. Text color secondaryd5caaf
  3. Border colord5caaf
  4. Background color primary000000
  5. Background color secondary1c1c1c
Beirut Ghost CMS Theme Color Scheme Dark

➄ Yellow

Demo →

  1. Text color primary000000
  2. Text color secondary000000
  3. Border color000000
  4. Background color primaryffe14b
  5. Background color secondaryFFDA1F
Beirut Ghost CMS Theme Color Scheme Yellow

➅ Purple

Demo →

  1. Text color primaryf3eeeb
  2. Text color secondaryf3eeeb
  3. Border color814b95
  4. Background color primary703288
  5. Background color secondary622C77
Beirut Ghost CMS Theme Color Scheme Purple

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.


Membership

Beirut has different interface elements for membership features.

  1. Footer subscribe form
  2. Call to action section on the post page to encourage visitors to subscribe if the post is for members only

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

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

Click Save.

Remove Ghost Portal / The Bottom Right Button

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

Remove Ghost Portal

Membership Troubleshooting Tips

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

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

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

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

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


If you still have an issue and using Ghost Pro, please reach out to the Ghost team. If you are using any self-hosting provider, please reach out to them for help.


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

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


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

Ghost CMS navigation menu

Add New Page to Navigaiton

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

Ghost CMS label field

Next, click on the item’s URL. The blog URL will already be auto-populated. Add the page slug after the final /.

Click the Save button.

Add Work Page to Navigation

Add a new navigation item, fill in the Label field and make sure to set the URL to /work/ like the following screenshot.

Beirut Ghost Theme Work Navigation

Add Writing Page to Navigation

Add a new navigation item, fill in the Label field and make sure to set the URL to /writing/ like the following screenshot.

Beirut Ghost Theme Writing Navigation

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


Ghost supports adding Facebook and Twitter URLs. Go to Settings > General > Social accounts and add your URLs from your site admin.

Ghost CMS Theme Social Accounts

Beirut supports adding Instagram, Dribbble, Linkedin, and Email URLs. Go to Settings > Design > Site-wide.

Beirut Ghost Theme Social Media Accounts Settings

The social links theme file is at /partials/social-links.hbs.


Languages

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

Theme Translation

Beirut 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 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 (de) looks like this:

{
  "Skip to content": "Zum Inhalt springen",

  "Page Not Found": "Page Not Found",

  "Work": "Work",
  "Writing": "Writing",
  "Services": "Services",
  "Technologies": "Technologies",
  "Clients": "Clients",
  "Next": "Next",

  "Loading": "Wird geladen",
  "Load More": "Weitere Artikel",

  "Subscribe": "Abonnieren",
  "Newsletter": "Newsletter",
  "Email address": "Email address",
  "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.",

  "This Content Is for Members": "Dieser Inhalt ist für Mitglieder",
  "This Content Is for Paid Members": "Dieser Inhalt ist für bezahlte Mitglieder",
  "Already have an account?": "Hast du schon ein Konto?",

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

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.

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

Portal Text & Translation

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

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

RTL

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

To enable the RTL option, open the partials/head.hbs theme file using a code editor and change line 7 to {{> css/dist/style-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 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 in 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.


Posts Per Page

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

"config": {
  "posts_per_page": 100
}

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

Note

This will not apply to the homepage but for the Work, Writing, Author, and Tag pages. For the homepage, checkout the Homepage section.


Typography Drop Caps

The theme comes with different styles of typography drop caps. It will apply to the first letter of the first word in 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-small'> </p>. Check below for the available classes for each style
  3. Add your paragraph text whith that <p> </p> HTML element
Beirut Ghost Theme Typography Dropcap HTML Card

There are currently four styles available.

➊ Small Drop Cap

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

The result.

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

Beirut Ghost Theme Typography Dropcap Large

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

Changing Theme Typeface

Beirut is using one typeface, DM Sans.

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

:root {
  --font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

To change the typeface to any from Google Fonts, use Code Injection Site Header.

For example, if you want to use the Roboto typeface 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', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  }
</style>

If you have a custom typeface, check out the Loading Custom Typeface section below.

You might find the following posts helpful as well:


Loading Custom Typeface

I assume that 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.


RSS Feed URL

You can access all content RSS feed at site.com/rss/.

You can access Work RSS feed at site.com/work/rss/.

You can access Writing RSS feed at site.com/writing/rss/.


Google Analytics

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


Update Favicon

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

Update Ghost CMS favicon

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

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, basically, 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.


Theme Deploy with GitHub Actions

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

Beirut documentation Ghost CMS Theme GitHub Actions

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

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


Code Injection

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

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

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

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


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.


I suggest using the SearchinGhostEasy plugin; it seems to be a good search solution and straightforward to install.

Tips

  • The plugin code for inserting an icon will not work correctly with Beirut; instead, use the following. Thanks Menka.
<script>
  $("ul.c-nav").append('<li class="nav-search"><a href="#searchinghost-easy"><svg width="14px" height="14px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M508.875,493.792L353.089,338.005c32.358-35.927,52.245-83.296,52.245-135.339C405.333,90.917,314.417,0,202.667,0 S0,90.917,0,202.667s90.917,202.667,202.667,202.667c52.043,0,99.411-19.887,135.339-52.245l155.786,155.786 c2.083,2.083,4.813,3.125,7.542,3.125c2.729,0,5.458-1.042,7.542-3.125C513.042,504.708,513.042,497.958,508.875,493.792z M202.667,384c-99.979,0-181.333-81.344-181.333-181.333S102.688,21.333,202.667,21.333S384,102.677,384,202.667 S302.646,384,202.667,384z"/></svg></a></li>');

  new SearchinGhostEasy({
    contentApiKey: '<CONTENT_API_KEY>'
  });
</script>
  • Also, when you replace the CONTENT_API_KEY with your Content API key value, remove the <>. For example, don’t do this.
new SearchinGhostEasy({
  contentApiKey: '<6969d471a04a2be4020f377569>'
});

It should be:

new SearchinGhostEasy({
  contentApiKey: '6969d471a04a2be4020f377569'
});

Cuong Tran is using this plugin on ghostFam with Ubud – I think he might help if you need a custom service to set it up.

If you have any issues or questions with the plugin, please get in touch with the authors.


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


AMP

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

Read more about AMP at Google AMP + Ghost

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


Theme Development

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/css/dist/style.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, it’s recommended you avoid editing these files. Instead, do customizations in assets/sass for CSS or in assets/js/app.js JavaScript. This way, you can make sure the flow is going in the right direction and never lose any changes.


My Current Setup

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

$ node -v
v14.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

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

➊ Using your computer program

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

Ghost theme zip on macOS

➋ Using the command line

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

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

➌ Using Gulp

Use the gulp zip command if you are running gulp.


Theme Update

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

There are two choices:

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

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


Your feedback is very welcome ♥

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

Thank you for your time!

Support

Have any questions? I’m here to help.

Contact Ahmad
Ahmad Ajmi