Penang – Documentation
Theme version:
1.3.1 — 22 July 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
- Upload the routes.yaml File (⚑ Required)
- Members / Subscriptions
- Dark Mode
- Navigation
- Home Hero
- Pages
- Comments
- Home Page Posts by Tag
- Home Page Authors
- Posts Per Page
- Related Posts
- Google Analytics
- Update Favicon
- Responsive Tables
- Social Sharing Icons
- Footer Social Media Icons
- Languages
- Syntax Highlighting
- Post Feature Image Size
- Footnotes
- Theme Deploy with GitHub Actions
- Code Injection
- Changing Colors with CSS Variables
- Customize Images Height
- Customize Logo Size
- Remove Date from All Posts
- Change Style Depending on the Screen Width
- Three Columns Layout Display for Home Posts
- Add Featured Posts Section to Homepage
- Open Post Links in a New Tab
- Add Reading Time
- Show Full Post Excerpt for Post Cards
- Changing Theme Typeface
- Loading Custom Typeface
- Fix Portal Button Hiding the Footer Social Media Icons
- Footer Copyright
- AMP
- Theme Development
- Theme Update
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 penang, you will find the penang.zip theme file and an online documentation file.
Follow these steps to upload the theme to your website:
- Log in to your Ghost website admin (example.com/ghost).
- Click the settings icon ( ) at the bottom of the left-hand side.
- Go to Design > Change theme.
- Click Upload theme and select the penang.zip theme file.
- Once uploaded, click Activate now to activate Penang.
Upload the routes.yaml File (⚑ Required)
To upload the file, follow these steps:
- Unzip the penang.zip theme file.
- In your Ghost admin, click the settings icon ( ) at the bottom of the left-hand side.
- Go to the Labs.
- Scroll down to the Routes section and click the Upload routes YAML button.
- Select and upload the
routes.yaml
file inside the theme folder.

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.
Upload the routes.yaml
file separately after uploading your theme zip file.
Members / Subscriptions
Make sure to Upload the routes.yaml file.
Penang has different interface elements for membership feature.
- Login In and Subscribe buttons in the header
- Footer and Hero subscription forms
- A post subscription form
- If the post is set to Members Only, a Call to Action section on the Post page to encourage visitors to subscribe
Remove ‘Log In’ and ‘Subscribe’ from Header
Add the following CSS code into the Ghost admin Code Injection Site Header.
<style>
.c-header .is-membership { display: none; }
</style>
Click Save. That’s all.
This will also remove the Account link, visible if logged in.
Remove ‘Public’, ‘Members’ and ‘Paid’ Labels from Post Card
Open the partials/post-card.hbs
file and remove lines 28
to 34
.
Once you finish, zip the theme files, and upload the final zip file to your Ghost website.
Or, copy and paste the following CSS code into the Ghost admin Code Injection Site Header.
<style>
.c-post-card__visibility { display: none; }
</style>
Embed the Subscribe Form in the Middle of a Blog Post
To add the Subscribe Form in the middle of a blog post, click on the + button and choose the HTML card.

Then paste the following code into the editor field and save your post.
<form data-members-form="subscribe" class="c-subscribe-form">
<div class="form-group">
<label for="subscribe-email-footer" class="u-hidden-visually">Your email address</label>
<input type="email" name="email" class="c-subscribe-form__input" id="subscribe-email-footer" placeholder="Your email address" data-members-email="">
<button type="submit" value="Subscribe" class="c-btn c-btn--action c-subscribe-form__btn">Subscribe</button>
</div>
<div class="u-alert u-alert--success u-mt-16">Please check your inbox and click the link to confirm your subscription.</div>
<div class="u-alert u-alert--invalid u-mt-16">Please enter a valid email address!</div>
<div class="u-alert u-alert--error u-mt-16">An error occurred, please try again later.</div>
</form>

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

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

Membership Troubleshooting Tips
If for any reason the subscribe form does not work, or there is an error message, the following tips might help:
First, make sure you run the latest version of Ghost.
If you are self-hosting your website, make sure to set up the mail config. After doing that, restart your Ghost server.
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.
Dark Mode
The dark mode is automatically activated based on the Operating System mode. Also, the reader can switch between dark and light mode from the header button.
Disable Dark Mode
To disable dark mode, add the following CSS code to the Ghost admin Code Injection (Site Header) section.
<style>
@media (prefers-color-scheme: dark) {
:root {
--color-mode: 'light';
}
:root:not([data-user-color-scheme]) {
--color-mode: 'light';
--color-brand: #e7131a;
--color-white: #FFFFFF;
--color-dark: #000C2D;
--color-text: #000C2D;
--color-gray: #4F525F;
--color-error: #CD3D64;
--color-success: #09815C;
--color-border: #000C2D;
--bg-color: var(--color-white);
--bg-gray: #EEF1F0;
--bg-white: var(--color-white);
--bg-transparent: rgba(255, 255, 255, .7);
--bg-post-card: var(--bg-white);
--bg-tag-list: linear-gradient(to left, var(--bg-color), rgba(255, 255, 255, 0));
--bg-gradient: linear-gradient(55deg,rgba(208,208,208,.03) 0,rgba(208,208,208,.03) 20%,rgba(55,55,55,.03) 20%,rgba(55,55,55,.03) 40%,rgba(81,81,81,.03) 40%,rgba(81,81,81,.03) 60%,rgba(208,208,208,.03) 60%,rgba(208,208,208,.03) 80%,rgba(191,191,191,.03) 80%,rgba(191,191,191,.03) 100%),linear-gradient(291deg,rgba(190,190,190,.02) 0,rgba(190,190,190,.02) 14.286%,rgba(105,105,105,.02) 14.286%,rgba(105,105,105,.02) 28.572%,rgba(230,230,230,.02) 28.572%,rgba(230,230,230,.02) 42.858%,rgba(216,216,216,.02) 42.858%,rgba(216,216,216,.02) 57.144%,rgba(181,181,181,.02) 57.144%,rgba(181,181,181,.02) 71.43%,rgba(129,129,129,.02) 71.43%,rgba(129,129,129,.02) 85.716%,rgba(75,75,75,.02) 85.716%,rgba(75,75,75,.02) 100.002%),linear-gradient(32deg,rgba(212,212,212,.03) 0,rgba(212,212,212,.03) 12.5%,rgba(223,223,223,.03) 12.5%,rgba(223,223,223,.03) 25%,rgba(11,11,11,.03) 25%,rgba(11,11,11,.03) 37.5%,rgba(86,86,86,.03) 37.5%,rgba(86,86,86,.03) 50%,rgba(106,106,106,.03) 50%,rgba(106,106,106,.03) 62.5%,rgba(220,220,220,.03) 62.5%,rgba(220,220,220,.03) 75%,rgba(91,91,91,.03) 75%,rgba(91,91,91,.03) 87.5%,rgba(216,216,216,.03) 87.5%,rgba(216,216,216,.03) 100%),linear-gradient(312deg,rgba(113,113,113,.01) 0,rgba(113,113,113,.01) 14.286%,rgba(54,54,54,.01) 14.286%,rgba(54,54,54,.01) 28.572%,rgba(166,166,166,.01) 28.572%,rgba(166,166,166,.01) 42.858%,rgba(226,226,226,.01) 42.858%,rgba(226,226,226,.01) 57.144%,rgba(109,109,109,.01) 57.144%,rgba(109,109,109,.01) 71.43%,rgba(239,239,239,.01) 71.43%,rgba(239,239,239,.01) 85.716%,rgba(54,54,54,.01) 85.716%,rgba(54,54,54,.01) 100.002%),linear-gradient(22deg,rgba(77,77,77,.03) 0,rgba(77,77,77,.03) 20%,rgba(235,235,235,.03) 20%,rgba(235,235,235,.03) 40%,rgba(215,215,215,.03) 40%,rgba(215,215,215,.03) 60%,rgba(181,181,181,.03) 60%,rgba(181,181,181,.03) 80%,rgba(193,193,193,.03) 80%,rgba(193,193,193,.03) 100%),linear-gradient(80deg,rgba(139,139,139,.02) 0,rgba(139,139,139,.02) 14.286%,rgba(114,114,114,.02) 14.286%,rgba(114,114,114,.02) 28.572%,rgba(240,240,240,.02) 28.572%,rgba(240,240,240,.02) 42.858%,rgba(221,221,221,.02) 42.858%,rgba(221,221,221,.02) 57.144%,rgba(74,74,74,.02) 57.144%,rgba(74,74,74,.02) 71.43%,rgba(201,201,201,.02) 71.43%,rgba(201,201,201,.02) 85.716%,rgba(187,187,187,.02) 85.716%,rgba(187,187,187,.02) 100.002%),linear-gradient(257deg,rgba(72,72,72,.03) 0,rgba(72,72,72,.03) 16.667%,rgba(138,138,138,.03) 16.667%,rgba(138,138,138,.03) 33.334%,rgba(54,54,54,.03) 33.334%,rgba(54,54,54,.03) 50.001%,rgba(161,161,161,.03) 50.001%,rgba(161,161,161,.03) 66.668%,rgba(17,17,17,.03) 66.668%,rgba(17,17,17,.03) 83.335%,rgba(230,230,230,.03) 83.335%,rgba(230,230,230,.03) 100.002%),linear-gradient(47deg,rgba(191,191,191,.01) 0,rgba(191,191,191,.01) 16.667%,rgba(27,27,27,.01) 16.667%,rgba(27,27,27,.01) 33.334%,rgba(66,66,66,.01) 33.334%,rgba(66,66,66,.01) 50.001%,rgba(36,36,36,.01) 50.001%,rgba(36,36,36,.01) 66.668%,rgba(230,230,230,.01) 66.668%,rgba(230,230,230,.01) 83.335%,rgba(93,93,93,.01) 83.335%,rgba(93,93,93,.01) 100.002%),linear-gradient(90deg,#fff,#fff);
}
}
[data-user-color-scheme='dark'] {
--color-mode: 'light';
--color-brand: #e7131a;
--color-white: #FFFFFF;
--color-dark: #000C2D;
--color-text: #000C2D;
--color-gray: #4F525F;
--color-error: #CD3D64;
--color-success: #09815C;
--color-border: #000C2D;
--bg-color: var(--color-white);
--bg-gray: #EEF1F0;
--bg-white: var(--color-white);
--bg-transparent: rgba(255, 255, 255, .7);
--bg-post-card: var(--bg-white);
--bg-tag-list: linear-gradient(to left, var(--bg-color), rgba(255, 255, 255, 0));
--bg-gradient: linear-gradient(55deg,rgba(208,208,208,.03) 0,rgba(208,208,208,.03) 20%,rgba(55,55,55,.03) 20%,rgba(55,55,55,.03) 40%,rgba(81,81,81,.03) 40%,rgba(81,81,81,.03) 60%,rgba(208,208,208,.03) 60%,rgba(208,208,208,.03) 80%,rgba(191,191,191,.03) 80%,rgba(191,191,191,.03) 100%),linear-gradient(291deg,rgba(190,190,190,.02) 0,rgba(190,190,190,.02) 14.286%,rgba(105,105,105,.02) 14.286%,rgba(105,105,105,.02) 28.572%,rgba(230,230,230,.02) 28.572%,rgba(230,230,230,.02) 42.858%,rgba(216,216,216,.02) 42.858%,rgba(216,216,216,.02) 57.144%,rgba(181,181,181,.02) 57.144%,rgba(181,181,181,.02) 71.43%,rgba(129,129,129,.02) 71.43%,rgba(129,129,129,.02) 85.716%,rgba(75,75,75,.02) 85.716%,rgba(75,75,75,.02) 100.002%),linear-gradient(32deg,rgba(212,212,212,.03) 0,rgba(212,212,212,.03) 12.5%,rgba(223,223,223,.03) 12.5%,rgba(223,223,223,.03) 25%,rgba(11,11,11,.03) 25%,rgba(11,11,11,.03) 37.5%,rgba(86,86,86,.03) 37.5%,rgba(86,86,86,.03) 50%,rgba(106,106,106,.03) 50%,rgba(106,106,106,.03) 62.5%,rgba(220,220,220,.03) 62.5%,rgba(220,220,220,.03) 75%,rgba(91,91,91,.03) 75%,rgba(91,91,91,.03) 87.5%,rgba(216,216,216,.03) 87.5%,rgba(216,216,216,.03) 100%),linear-gradient(312deg,rgba(113,113,113,.01) 0,rgba(113,113,113,.01) 14.286%,rgba(54,54,54,.01) 14.286%,rgba(54,54,54,.01) 28.572%,rgba(166,166,166,.01) 28.572%,rgba(166,166,166,.01) 42.858%,rgba(226,226,226,.01) 42.858%,rgba(226,226,226,.01) 57.144%,rgba(109,109,109,.01) 57.144%,rgba(109,109,109,.01) 71.43%,rgba(239,239,239,.01) 71.43%,rgba(239,239,239,.01) 85.716%,rgba(54,54,54,.01) 85.716%,rgba(54,54,54,.01) 100.002%),linear-gradient(22deg,rgba(77,77,77,.03) 0,rgba(77,77,77,.03) 20%,rgba(235,235,235,.03) 20%,rgba(235,235,235,.03) 40%,rgba(215,215,215,.03) 40%,rgba(215,215,215,.03) 60%,rgba(181,181,181,.03) 60%,rgba(181,181,181,.03) 80%,rgba(193,193,193,.03) 80%,rgba(193,193,193,.03) 100%),linear-gradient(80deg,rgba(139,139,139,.02) 0,rgba(139,139,139,.02) 14.286%,rgba(114,114,114,.02) 14.286%,rgba(114,114,114,.02) 28.572%,rgba(240,240,240,.02) 28.572%,rgba(240,240,240,.02) 42.858%,rgba(221,221,221,.02) 42.858%,rgba(221,221,221,.02) 57.144%,rgba(74,74,74,.02) 57.144%,rgba(74,74,74,.02) 71.43%,rgba(201,201,201,.02) 71.43%,rgba(201,201,201,.02) 85.716%,rgba(187,187,187,.02) 85.716%,rgba(187,187,187,.02) 100.002%),linear-gradient(257deg,rgba(72,72,72,.03) 0,rgba(72,72,72,.03) 16.667%,rgba(138,138,138,.03) 16.667%,rgba(138,138,138,.03) 33.334%,rgba(54,54,54,.03) 33.334%,rgba(54,54,54,.03) 50.001%,rgba(161,161,161,.03) 50.001%,rgba(161,161,161,.03) 66.668%,rgba(17,17,17,.03) 66.668%,rgba(17,17,17,.03) 83.335%,rgba(230,230,230,.03) 83.335%,rgba(230,230,230,.03) 100.002%),linear-gradient(47deg,rgba(191,191,191,.01) 0,rgba(191,191,191,.01) 16.667%,rgba(27,27,27,.01) 16.667%,rgba(27,27,27,.01) 33.334%,rgba(66,66,66,.01) 33.334%,rgba(66,66,66,.01) 50.001%,rgba(36,36,36,.01) 50.001%,rgba(36,36,36,.01) 66.668%,rgba(230,230,230,.01) 66.668%,rgba(230,230,230,.01) 83.335%,rgba(93,93,93,.01) 83.335%,rgba(93,93,93,.01) 100.002%),linear-gradient(90deg,#fff,#fff);
}
</style>
Click Save.
Disable Light Mode
To disable light mode, add the following CSS code to the Ghost admin Code Injection (Site Header) section.
<style>
:root {
--color-brand: #e7131a;
--color-white: #FFFFFF;
--color-dark: #010101;
--color-text: #FFFFFF;
--color-gray: #E5EFF5;
--color-error: #CC3C64;
--color-success: #1BA672;
--color-border: #383B40;
--bg-color: #111016;
--bg-gray: #18181d;
--bg-white: var(--color-white);
--bg-transparent: rgba(31, 32, 35, .7);
--bg-post-card: var(--bg-gray);
--bg-tag-list: linear-gradient(to left, var(--bg-color), rgba(31, 32, 35, 0));
--bg-gradient: --bg-gray;
--color-mode-icon: var(--icon-sun);
--color-mode-icon-filter: var(--icon-sun-filter);
}
</style>
Click Save.
Remove the Header Dark Mode Switch Button
If you want to remove the header dark mode switch button. Open the partials/header.hbs
file and remove lines from 26
to 31
.
Add Different Logo Images for Light and Dark Modes
➊ Add the Logo Files to the Theme
In your theme, add two different logo files inside the /assets
folder, one for light mode and the other for the dark mode. Please name each file as follows:
light-logo.png
to be visible for light mode.dark-logo.png
to be visible for dark mode.
➋ Change header.hbs file
Open the partials/header.hbs
theme file and replace lines from 4
to 12
with the following code snippet.
<a href='{{ @site.url }}' class='c-logo'>
<span class='u-hidden-visually'>{{ @site.title }}</span>
</a>
➌ Add Custom CSS Code
Using Ghost Code Injection admin tool, add the following CSS code to the Site Header
section.
<style>
:root {
--logo-image: url('/assets/light-logo.png');
}
@media (prefers-color-scheme: dark) {
:root:not([data-user-color-scheme]) {
--logo-image: url('/assets/dark-logo.png');
}
}
[data-user-color-scheme='dark'] {
--logo-image: url('/assets/dark-logo.png');
}
.c-logo {
width: 40px;
height: 40px;
display: block;
background-size: contain;
background-position: center;
background-repeat: no-repeat;
background-image: var(--logo-image);
}
</style>
Click Save.
Logo Note
- You might want to change the logo
width
andheight
by changing the value of40px
to match your logo preference and to get the best result. - If the logo image has a large white space around it, trim that space with a photo editing app for better results.
- You will probably need to remove the browser cache for things to take effect.
- This way will ignore the logo uploaded from the Ghost admin and the theme now will use the logos located in the theme.
Add Different Hero Image for Light and Dark Modes
➊ Add the Image Files to the Theme
In your theme, add two different image files inside the /assets
folder, one for light mode and the other for the dark mode. Please name each file as follows:
light-hero.png
to be visible for light mode.dark-hero.png
to be visible for dark mode.
➋ Change hero.hbs file
Open the partials/hero.hbs
theme file and replace lines from 15
to 19
with the following code snippet.
<div class='o-grid__col o-grid__col--4-4-s o-grid__col--2-4-m'>
<div class='c-hero-image'></div>
</div>
➌ Add Custom CSS Code
Using Ghost Code Injection admin tool, add the following CSS code to the Site Header
section.
<style>
:root {
--hero-image: url('/assets/light-hero.png');
}
@media (prefers-color-scheme: dark) {
:root:not([data-user-color-scheme]) {
--hero-image: url('/assets/dark-hero.png');
}
}
[data-user-color-scheme='dark'] {
--hero-image: url('/assets/dark-hero.png');
}
.c-hero-image {
max-width: 350px;
height: 350px;
background-size: contain;
background-position: center;
background-repeat: no-repeat;
background-image: var(--hero-image);
}
</style>
Hero Image Note
- You might want to change the image
max-width
andheight
by changing the value of350px
to match your image preference and to get the best result. - You will probably need to remove the browser cache for things to take effect.
- This way will ignore the image uploaded from the Ghost admin and the theme now will use the images located in the theme.
Navigation
You can add, edit, delete, and reorder the navigation menu in Ghost Admin from the Settings → Navigation page.

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.

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.
Secondary Navigation
Currently, the theme shows the Ghost Primary Navigation in both the header and footer.
To show the Secondary Navigation items in the footer section, open the partials/footer.hbs
theme file using a code editor and replace line 20
with the following line.
{{ navigation type='secondary' }}
That’s all you need to do.
Home Tags Navigation
The home tags navigation will automatically show all the blog tags in alphabetical order.

If you want to remove the tags navigation, open the index.hbs
theme file using a code editor and remove lines from 5
to 8
.
If you want to only show specific tags, open the partials/index-tag-list.hbs
and replace line 2
with the following line after replacing each TAG_SLUG
with your tag Slug.
{{#get 'tags' limit='all' filter='slug:[TAG_SLUG, TAG_SLUG, TAG_SLUG]'}}
So, if you have tag slugs like tech-vc, design, coding, it should be like:
{{#get 'tags' limit='all' filter='slug:[tech-vc, design, coding]'}}
Note the Comma (,
) separating each slug.
Note
If the tag is empty with no posts, it will not be visible. Add the tag to any post, and it will appear.
This way does not guarantee to get the same tags in the same order as you added the slugs. Probably a Ghost issue. Instead, use the following method.
In this method, we get each page separately. For example, to get the design
and coding
tags, the partials/index-tag-list.hbs
will look like.
<div class='o-grid__col o-grid__col--full'>
<div class='c-tags-list-wrap'>
<ul class='c-tags-list o-plain-list dragscroll'>
{{#get 'tags' filter='slug:[design]'}}
{{#foreach tags}}
<li><a href='{{ url }}'>{{ name }}</a></li>
{{/foreach}}
{{/get}}
{{#get 'tags' filter='slug:[coding]'}}
{{#foreach tags}}
<li><a href='{{ url }}'>{{ name }}</a></li>
{{/foreach}}
{{/get}}
</ul>
</div>
</div>
Home Hero

The hero section shows the site Publication cover and the site description. You can edit them from the Ghost admin General settings admin page.
Publication Cover
- Settings > General > Branding > Publication cover
Site Description
- Settings > General > PUBLICATION INFO > Title & description
You can add normal HTML tags to the description like links or headings. The theme will automatically render them on the browser. For example, the demo description is the following:
<h1>Hello, <br>I’m Penang </h1><p>Create a subscription Ghost blog with a beautiful & minimalist design.</p>

The website’s title, which appears on the header, will not automatically visible in the hero description/tagline. Instead, you can add it as part of the blog description, like the example above.
If you want to add the above HTML/hero description in the theme file, open the partials/hero.hbs
theme file using a code editor and add your custom description instead of file line 5.
Remove Home Hero Section
If you want to completely remove the Hero section, open index.hbs
file and remove line 4
{{> hero }}
.
Changing Hero Background Color
To change the home hero background color, you can add the following CSS snippet to the Ghost admin Code Injection Site Header and replace YOUR_COLOR_HERE
with your HTML color code, e.g., #942d76
;
<style>
.c-hero {
background: YOUR_COLOR_HERE;
}
</style>
Click Save.
If you want to change the color for dark and light modes, you can use the following code and and replace YOUR_LIGHT_COLOR_HERE
and YOUR_DARK_COLOR_HERE
with your color.
<style>
:root {
--hero-background: YOUR_LIGHT_COLOR_HERE;
}
@media (prefers-color-scheme: dark) {
:root:not([data-user-color-scheme]) {
--hero-background: YOUR_DARK_COLOR_HERE;
}
}
[data-user-color-scheme='dark'] {
--hero-background: YOUR_DARK_COLOR_HERE;
}
.c-hero {
background: var(--hero-background);
}
</style>
Notice that I duplicated the variable for dark mode in two blocks.
Replace Hero Subscribe Form with a Subscribe Button
To add a subscribe button to the Subscribe page as the header button instead of the form, do the following.
Open the partials/hero.hbs
theme file using a code editor, and replace line 8
with the following:
<br><a href='#/portal/signup' class='c-btn c-btn--action'>{{t 'Subscribe' }}</a>
If you prefer a wider button, use the c-btn--full
class. The code would be:
<br><a href='#/portal/signup' class='c-btn c-btn--full c-btn--action'>{{t 'Subscribe' }}</a>
Pages
Manage pages for Tags, Authors, and Contact from the Pages section of Ghost admin.
Tags Page
Follow these steps to create the Tags page:
- From the Ghost admin Pages section, create a new page and give it a title, like “Tags”.
- From Page settings, select the Tags template.
- Publish the page.
- To add the page to the navigation, please check the Navigation section.

Note for Self-hosters
If you are self-hosting your website, you may need to do a server restart. This should get the Tags option to show up in the Template dropdown.
Authors Page
To create the Authors page:
- Create a new page and give it a title, like “Authors”.
- From Page settings, select the Authors template.
- Publish the page
- To add the page to the navigation, please check the Navigation section above

Note for Self-hosters
If you are self-hosting your website, you may need to do a server restart. This should get the Authors option to show up in the Template dropdown.
Contact Page
To create the Contact page:
- Create a new Page and give it a title, like “Contact”.
- Add your content and the contact form code using Formspree as a service. Please check the code example below.
- Publish the page.
- To add the page to the navigation, please check the Navigation section.
<form action="https://formspree.io/your@email.com" method="POST">
<input type="text" name="name" placeholder="Name">
<input type="email" name="_replyto" placeholder="Email">
<textarea name='message' placeholder="Message"></textarea>
<input class='c-btn' type="submit" value="Send">
</form>
For more information, check out How to Add a Contact Form to Your Ghost Blog.
Comments
The theme supports comments from Disqus, Commento and CommentBox.
If you display comments for logged-in readers, they will need to log in/register into the comment system again. As you know, Ghost has no comment system, and these are third-party tools that are not integrated with and not part of Ghost.
Please contact their authors or check out their documentation for questions or issues about the commenting systems.
Disqus
To enable Disqus as a comments system, open the partials/disqus.hbs
theme file using a code editor. Replace the aspirethemes-demos
value with the disqus_shortname
variable to match your Disqus account shortname.
var disqus_shortname = 'aspirethemes-demos';
So, if your Disqus shortname is exampleone
, the final code above should be:
var disqus_shortname = 'exampleone';
Once you finish, zip the theme files, and upload the final zip file to your Ghost website.
From the theme side, that’s all you need to set up Disqus. If you have any issues with comments not loading, make sure you have registered your website with Disqus (Step 1).
If you still have issues, check the Disqus troubleshooting guide.
Disable Disqus
To disable Disqus comments, open the post.hbs
theme file using a code editor and delete the line containing the {{> disqus}}
text (line 29
).
Once you finish, zip the theme files, and upload the final zip file to your Ghost website.
A quick way to disable Disqus is to 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.

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://keeganleary.com/disqus-is-evil-trash/.
Also, be aware of Disqus trackings. Check out https://supunkavinda.blog/disqus.
So, you might want to use another commenting system.
Thanks for sharing, Keegan!
Autoload Disqus
If you want to autoload Disqus without clicking the Comments button, open the partials/disqus.hbs
theme file using a code editor and replace the file content with the following code.
<div id='disqus_thread'></div>
<script>
var disqus_shortname = 'aspirethemes-demos'; // required: replace `aspirethemes-demos` with your Disqus shortname
// DON'T EDIT BELOW THIS LINE
var disqus_config = function () {
this.page.url ='{{url absolute="true"}}'
this.page.identifier = 'ghost-{{comment_id}}';
};
var d = document, s = d.createElement('script');
s.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
</script>
CommentBox
To enable CommentBox as a comments system, open post.hbs
file and replace line 29
replace with {{> 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/commentbox.hbs
theme file using a code editor and replace the my-project-id
value with it. That’s it.
Commento
To enable Commento as a comments system, open the post.hbs
theme file using a code editor and replace line 29
with {{> commento}}
.
The next step is to create a Commento account and register your domain with it.
Home Page Posts by Tag

With this feature, you can show posts at the home page by a specific tag. To do this, open the partials/index-tag-columns.hbs
theme file using a code editor and you fill find 3 code blocks, everyone looks like the following screenshot:

They are already configured with some tags but you will need to change them according to your own existed tags.
- Tag slug
- Tag slug
- Tag Name
Home Page Authors
The home page Authors section shows 3 authors ordered by posts count.
To remove this section, open the index.hbs
theme file using a code editor and remove line 26
({{> index-authors }}
).
To change the visible Authors number, open the partials/index-authors.hbs
file and change the limit from 3
to the number you want to show.
Posts Per Page
You can control how many posts display per page from the package.json
file.
"config": {
"posts_per_page": 12
}
The theme default value is set to 12
posts per page.
Related Posts
Related posts section will be visible at the bottom of a post if other posts share the same tags as the current post.
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.
Responsive Tables
Responsive tables are required and essential for adding tabular content and allowing tables to be scrolled horizontally. You can make any table responsive across all viewports by wrapping a table
with .responsive-table
, for example:
<div class='responsive-table'>
<table>
...
</table>
</div>
Social Sharing Icons
You can customize and update a post’s social media sharing icons from the partials/share.hbs
theme file.
Footer Social Media Icons
Footer social media links are placed in the partials/social-icons.hbs
file.
Ghost supports adding Facebook and Twitter profile URLs from the admin panel. Go to General > Social accounts and add your URLs. This will update Facebook and Twitter URLs within the footer social media section.

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:
<span data-icon='ei-sc-facebook' data-size='s'></span>
GitHub
<span data-icon='ei-sc-github' data-size='s'></span>
<span data-icon='ei-sc-instagram' data-size='s'></span>
<span data-icon='ei-sc-linkedin' data-size='s'></span>
Odnoklassniki
<span data-icon='ei-sc-odnoklassniki' data-size='s'></span>
<span data-icon='ei-sc-pinterest' data-size='s'></span>
Skype
<span data-icon='ei-sc-skype' data-size='s'></span>
SoundCloud
<span data-icon='ei-sc-soundcloud' data-size='s'></span>
Telegram
<span data-icon='ei-sc-telegram' data-size='s'></span>
Tumblr
<span data-icon='ei-sc-tumblr' data-size='s'></span>
<span data-icon='ei-sc-twitter' data-size='s'></span>
Vimeo
<span data-icon='ei-sc-vimeo' data-size='s'></span>
VK
<span data-icon='ei-sc-vk' data-size='s'></span>
Youtube
<span data-icon='ei-sc-youtube' data-size='s'></span>
As mentioned above, Ghosts supports adding only Twitter and Facebook links from the admin. But the theme comes with other social icons in the sidebar. Edit or update these in the partials/sidebar-social-icons.hbs
file. For example, here’s the Instagram code block:
<li class='c-social-icons__item'>
<a href='#' aria-label='Instagram' target='_blank' rel='noopener'>
<span class='c-social-icons__icon' data-icon='ei-sc-instagram' data-size='s'></span>
</a>
</li>
The code above contains the ICON code from the above list and the social media link (a
) within a list element (li
).
Next, replace your Instagram full URL with the link href
value. If your Instagram URL is:
https://www.instagram.com/ghost/
Then the new code will be:
<li class='c-social-icons__item'>
<a href='https://www.instagram.com/ghost/' aria-label='Instagram' target='_blank' rel='noopener'>
<span class='c-social-icons__icon' data-icon='ei-sc-instagram' data-size='s'></span>
</a>
</li>
If you want to remove Instagram altogether, you can delete all the code blocks, the li
, a
, and the icon.
Languages
Penang ships with many languages already. But if you’d like to add another one, you’ll be able to do that too.
Theme Translation
Penang 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 Arabicda
for Danishde
for Germanyen
for Englishes
for Spanishfi
for Finnishfr
for Frenchit
for Italiannl
for Dutchpt
for Portuguesetr
for Turkish

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.
- 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
ja
and the file name will beja.json
. - In the same locales folder, open the
en.json
file and copy its content into your new language file. - Start translating, as shown in the following Edit Translation section.
- Go to your Ghost admin Settings > General > PUBLICATION INFO and enter your language ISO code into the Publication Language field. For example,
ja
. - 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 looks like this:
{
"Loading": "Wird geladen",
"More Posts": "Weitere Artikel",
"Recent Posts": "kürzliche Artikel",
"Featured Post": "Featured Artikel",
"Page Not Found": "Seite nicht gefunden",
"Load Comments": "Bemerkungen",
"You might also like": "Das könnte Sie auch interessieren:",
"Tags": "Stichworte",
"Authors": "Autoren",
"Navigation": "Navigation",
"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",
"Search": "Suche",
"Search {siteTitle}": "Suche {siteTitle}",
"Type to Search": "Suchbegriff(e) eingeben",
"Enable dark mode": "Schakel de donkere modus in",
"Paid": "Bezahlt",
"Members": "Mitglieder",
"Public": "Öffentlichkeit",
"Account": "Konto",
"Log in": "Einloggen",
"Log out": "Ausloggen",
"Continue": "Fortsetzen",
"Subscribe": "Abonnieren",
"Your email address": "Deine E-Mail-Adresse",
"Please check your inbox and click the link to complete the login.": "Bitte überprüfen Sie Ihren Posteingang und klicken Sie auf den Link, um die Anmeldung abzuschließen.",
"Please check your inbox and click the link to confirm your subscription.": "Bitte überprüfen Sie Ihren Posteingang und klicken Sie auf den Link, um Ihr Abonnement zu bestätigen.",
"Please enter a valid email address!": "Bitte geben Sie eine gültige E-Mail-Adresse ein!",
"An error occurred, please try again later.": "Ein Fehler ist aufgetreten. Bitte versuchen Sie es später erneut.",
"Already have an account?": "Hast du schon ein Konto?",
"Don't have an account yet?": "Sie haben noch keinen Account?",
"This post is for paying subscribers only": "Dieser Beitrag ist nur für zahlende Abonnenten",
"This post is for subscribers only": "Dieser Beitrag ist nur für Abonnenten",
"This post is for subscribers on the ": "Dieser Beitrag ist für Abonnenten der ",
"This page is for paying subscribers only": "Diese Seite ist nur für zahlende Abonnenten",
"This page is for subscribers only": "Dieser Seite ist nur für Abonnenten",
"This page is for subscribers on the ": "Diese Seite ist für Abonnenten der ",
"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 ("More Posts"
) and a right value ("Mehr Artikel"
).
The key is plain English that exists in all translation files and should not be changed. You should change only the value.
If you have any suggestions to improve a current translation or add a new language, please contact me.
Portal Text & Translation
There is no way to change or translate the Portal text yet. The Portal is not part of the theme files but a core Ghost component.
I suggest reaching out to the Gost team ( support@ghost.org ); so they might work on this issue or have a workaround.
RTL
RTL means right to left. Turning on RTL makes the theme readable for languages written from right to left, like Arabic or Hebrew.
To enable the RTL option, open the partials/head.hbs
theme file using a code editor and change line 10
to {{> compiled/inline-css-rtl }}
.
Save the file and upload the theme to your Ghost blog.
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.
Syntax Highlighting
You can add a fenced code block by placing triple backticks ```
before and after the code block. For example:
``` pre { background-color: #f4f4f4; max-width: 100%; overflow: auto; } ```
Will produce the following gray look:

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:

To add inline code, wrap the text between two backticks ` `
.
Prism
Penang 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.

Post Feature Image Size
An image width of (1320px
× 742px
) would fit the homepage cards and the post header.
You can also use an image with a double size (2640px
× 1484px
) for a high-resolution image preview.
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.
Theme Deploy with GitHub Actions
Penang 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.

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.
Code Injection
Another choice for customization is to use the Ghost Code Injection settings in Ghost admin.
For a CSS example, you can use the following code in the Site Header section to change the logo color and font size.
<style>
.c-logo__link {
color: #4550E5;
font-size: 32px;
}
</style>
Watch the following short video about Ghost Code Injection, how it works, and how to use it.
Changing Colors with CSS Variables
Using Code Injection, you can change the theme colors for the light and dark modes with CSS Variables.
For a list of available theme variables, check:
- Light theme:
assets/sass/settings/colors.scss
- Dark theme:
assets/sass/settings/colors-dark.scss
Don’t change the colors in these files; use it only as a reference for the available CSS Variables and instead use Code Injection as mentioned below to change the colors.
Suppose you want, for example, to change the theme background and brand colors. You can copy the color variable and add it inside each code block like in the following example.
The brand color is the colors shown in buttons and content links.
<style>
:root {
--bg-color: red;
--color-brand: red;
}
@media (prefers-color-scheme: dark) {
:root:not([data-user-color-scheme]) {
--bg-color: green;
--color-brand: red;
}
}
[data-user-color-scheme='dark'] {
--bg-color: green;
--color-brand: red;
}
</style>
Notice that we duplicated the variable for dark mode in two blocks.
In the above example, we changed the color for the light mode to red
and green
for the dark mode. You can override this for any other variable.
If, for example, you want to add another color that is not available in the available theme variables and wants to add another style to a new element. You can create a new variable and give it a name and value.
We can extend the previous example to add a new color for the logo color and assign that variable to the .c-logo__link
class.
<style>
:root {
--bg-color: red;
--color-brand: red;
--color-logo: blue;
}
@media (prefers-color-scheme: dark) {
:root:not([data-user-color-scheme]) {
--bg-color: green;
--color-brand: red;
--color-logo: gold;
}
}
[data-user-color-scheme='dark'] {
--bg-color: green;
--color-brand: red;
--color-logo: gold;
}
.c-logo__link {
color: var(--color-logo);
}
</style>
The logo will have blue
color for the light mode and a gold
color for the dark mode.
Customize Images Height
If you want to customize the height of the images on the home page and on the post page, you can use the following CSS code.
For the single post image. The theme default value is 56.25%
. You can change this value to match your preference.
.c-post-image-wrap:after {
padding-bottom: 56.25%;
}
For the homepage cards. The theme default value is 75%
.
.c-post-card__image-wrap {
padding-top: 75%;
}
The full code in Code Injection would be:
<style>
.c-post-image-wrap:after {
padding-bottom: 56.25%;
}
.c-post-card__image-wrap {
padding-top: 75%;
}
</style>
Customize Logo Size
If you are using an image as a logo (instead of the site name) and want to change the logo size, use the following code in Code Injection.
<style>
.c-logo__img {
max-height: 32px;
}
</style>
The default value is 32px
, so you can increase this value to match your preference.
If the logo image has a large white space around it, trim that space with a photo editing app for better results.
Remove Date from All Posts
To remove the date from all posts, add the following CSS code into the Ghost admin Code Injection Site Header section.
<style>
time {
display: none;
}
</style>
Click Save.
This code will remove the date from the following:
- Homepage postcards
- Post page
Change Style Depending on the Screen Width
To change the style of any element depending on the screen size the thme provides 3 stages, the initial/mobile size, the medium size, and the large size. For examplle, if you want to change the color of the post title on the three different stages, use the following code.
<style>
.c-post-header__title {
color: gray;
}
@media (min-width: 40em) {
.c-post-header__title {
color: red;
}
}
@media (min-width: 64em) {
.c-post-header__title {
color: green;
}
}
</style>
The title will start with gray on the mobile size, red on medium and green on large screens.
Three Columns Layout Display for Home Posts
Open the partials/post-card.hbs
file and replace line one with the following code line.
<div class='js-grid__col o-grid__col o-grid__col--initial-grow o-grid__col--4-4-s o-grid__col--2-4-m o-grid__col--1-3-l js-post-card-wrap c-post-card-wrap {{ post_class }}'>
The result will look like this:

If you want one column, use the following code.
<div class='js-grid__col o-grid__col o-grid__col--initial-grow o-grid__col--4-4-s js-post-card-wrap c-post-card-wrap {{ post_class }}'>
Add Featured Posts Section to Homepage
On the homepage, the theme shows the posts based on the Ghost default publishing order without creating a new section or separation for featured posts. To add a separate section for featured posts, do the following steps.
- Make sure you already have some posts marked as featured from the post setting. Well, the posts you are going to show.
- If you are working on a local development Ghost server, you may need to restart your Ghost server for the new template files to reflect.
➊ In the theme partials folder, create a new theme file post-card-featured.hbs
and copy the following code to it.
<div class='o-grid__col o-grid__col--initial-grow o-grid__col--4-4-s o-grid__col--2-4-m o-grid__col--2-4-l c-post-card-wrap {{ post_class }}'>
<div class='c-post-card {{#if featured}} c-post-card--featured {{/if}} {{#is 'home'}} {{/is}} {{#if feature_image}} c-post-card--with-image {{/if}} {{#unless feature_image}} c-post-card--no-image {{/unless}}'>
{{#if feature_image}}
<div class='c-post-card__media'>
<a href='{{ url }}' class='c-post-card__image-wrap' aria-hidden='true' tabindex='-1'>
<img
alt='{{ title }}'
class='c-post-card__image lazyload'
data-srcset='
{{ img_url feature_image size='md' }} 320w,
{{ img_url feature_image size='lg' }} 636w,
{{ img_url feature_image size='xl' }} 1272w'
sizes='(min-width: 1480px) 636px, (min-width: 640px) 44.39vw, calc(100vw - 32px)'
data-src='{{ img_url feature_image size='xl' }}'
>
</a>
</div>
{{/if}}
<div class='c-post-card__content {{#unless feature_image}} c-post-card__content--no-image {{/unless}}'>
<div class='c-post-card__meta'>
{{#primary_author}}
<a href='{{ url }}' class='c-post-card__author'>{{ name }}</a>
{{/primary_author}}
<time class='c-post-card__date' datetime='{{ date format='YYYY-MM-DD' }}' title='{{ date format='DD MMMM YYYY' }}'>{{ date format='DD MMM YYYY' }}</time>
<div class='c-post-card__visibility c-post-card__visibility--{{ visibility }}'>
<span class='paid'>{{t 'Paid' }}</span>
<span class='members'>{{t 'Members' }}</span>
<span class='public'>{{t 'Public' }}</span>
</div>
</div>
<h2 class='c-post-card__title'>
<a href='{{ url }}' class='c-post-card__title-link'>
{{ title }}
</a>
</h2>
<p class='c-post-card__excerpt'>{{ excerpt }}</p>
</div>
</div>
</div>
➋ In the theme root, create a new file home.hbs
and copy the following code in to it.
{{!< default}}
<div class='o-wrapper'>
{{> hero }}
<div class='o-grid'>
{{> index-tag-list }}
</div>
{{#get 'posts' filter='featured:true' limit='all' as |featured_posts|}}
{{#if featured_posts}}
<div class='o-grid'>
<div class='o-grid__col o-grid__col--full'>
<div class='c-title-bar'>
<h3 class='c-title-bar__title'>Featured Posts</h3>
</div>
</div>
</div>
<div class='o-grid'>
{{#foreach featured_posts}}
{{> post-card-featured }}
{{/foreach}}
</div>
<div class='o-grid'>
<div class='o-grid__col o-grid__col--full'>
<div class='c-title-bar'>
<h3 class='c-title-bar__title'>Recent Posts</h3>
</div>
</div>
</div>
{{/if}}
{{/get}}
<div class='o-grid js-grid'>
{{> loop }}
</div>
<div class='o-grid'>
{{ pagination }}
</div>
<div class='o-grid'><hr></div>
<div class='o-grid'>
{{> index-tag-columns }}
</div>
<div class='o-grid'><hr></div>
<div class='o-grid'><hr></div>
{{> index-authors }}
</div>
This code is a copy of the index.hbs
file plus a new code block which will do the following:
- Loop over all the featured posts. You can manage the limit from the
limit='all'
attribute. You can show a fixed number, for example,limit='2'
will show only two posts. - It will add the Featured Posts headline
- It will add the Recent Posts headline to separate both sections
Once you finish, zip the theme files, and upload the final zip file to your Ghost website.
If you want to exclude the featured posts from the recent posts section, update the routes.yaml
file to be.
routes:
/:
template: home
controller: channel
filter: featured:false
collections:
/:
permalink: /{slug}/
template: index
taxonomies:
tag: /tag/{slug}/
author: /author/{slug}/
Save and Upload the routes.yaml file to your website.
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 Reading Time
There are two places you can add the post reading time, the article page and the postcard in the homepage and other listing pages.
To add reading time on the article page under the title, open the partials/post-header.hbs
theme file using a code editor and add the following line of code under the line42
.
<span class='c-post-header__date'>{{ reading_time minute=(t '1 min read') minutes=(t '% min read') }}</span>
To add it in the homepage post card above the title area, open the partials/post-card.hbs
theme file and add the following line of code under the line 26
.
<span class='c-post-card__date'>{{ reading_time minute=(t '1 min read') minutes=(t '% min read') }}</span>
To learn more about how the reading time helper works, check out the Ghost documentation.
Show Full Post Excerpt for Post Cards
The theme uses the Ghost `excerpt to output the post excerpt under the homepage post title cards. It only shows two lines of it.
To display the full excerpt, add the following CSS snippet code into the Ghost admin Code Injection Site Header.
<style>
.c-post-card__excerpt {
display: block;
}
</style>
Changing Theme Typeface
Penang is using two fonts:
- Inter for the overall theme text.
- Crimson Text for the post content and post card excerpt.
The theme loads both fonts using Google Fonts in the theme partials/fonts.hbs
file.
Inter font is then assigned it to the body
element along with other system fonts as a backup as the following example.
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
}
Crimson Text is assigned to the post card excerpt as.
.c-post-card__excerpt {
font-family: 'Crimson Text', Georgia, serif;
}
And for the content text elements as.
.c-content dl,
.c-content fieldset,
.c-content form,
.c-content ol,
.c-content p,
.c-content pre,
.c-content ul {
font-family: 'Crimson Text', Georgia, serif;
}
To change to any other font, you need to include the font on your theme or using Code Injection Site Header if you are using Google Fonts, for example.
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>
body {
font-family: 'Roboto', sans-serif;
}
</style>
You need to change that to the buttons and input elements.
<style>
.c-post-card__excerpt {
font-family: 'Roboto', sans-serif;
}
</style>
<style>
.c-content dl,
.c-content fieldset,
.c-content form,
.c-content ol,
.c-content p,
.c-content pre,
.c-content ul {
font-family: 'Roboto', sans-serif;
}
</style>
You might find the following posts useful as well:
- How to Change a Ghost Theme Font Using Google Fonts
- How to Change the Fonts of the Casper Ghost CMS Theme Using Google Fonts
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.
Fix Portal Button Hiding the Footer Social Media Icons
If the Portal button covers the social icons and some are not visible or clickable, use the following CSS code into the Ghost admin Code Injection Site Header. It will move the button to the top and make the icons clickable.
<style>
.gh-portal-triggerbtn-iframe {
bottom: 40px !important;
}
</style>
You might also try to increase the bottom 40px
value to move it higher if the icons are still not visible.
Footer Copyright
You can update the footer copyright line information from the theme partials/footer.hbs
file. Open and edit that file using a code editor.
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.
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
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 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.

➋ Using the command line
zip -r penang.zip penang -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 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.
