Ghost Theme Customization: Editing the Ruby Theme in a Local macOS Dev Environment
How to customize the Ruby theme of a Ghost blog on macOS — the whole process from building a local dev environment with nvm and Node.js to applying the Pretendard font, setting up robots.txt, and packaging and applying the theme.
Starting Ghost Theme Customization
After installing the Ghost blog, I decided to try modifying the theme myself. Rather than making lots of changes, the goals were to understand the structure, swap the default font for Pretendard (which suits Korean text well), and add a robots.txt file for search crawler settings. Like WordPress, the fonts Ghost provides are mostly suited to English, so I consider this step essential for a Korean blog.
1. Setting Up a Local Ghost Dev Environment
To modify a theme, you first need a Ghost development environment. For this I installed the following tools on macOS:
- nvm: for easy Node.js version management
- Node.js: the version Ghost recommends (currently v20.x)
- yarn: the package manager needed for Ghost theme development
I covered this in a previous post.
2. Checking That Ghost Is Running
In the terminal, move to the Ghost install directory.
cd ~/ghost-devCheck the status of the installed Ghost instance.
ghost ls┌─────────────┬──────────────┬─────────┬─────────┬─────┬──────┬─────────────────┐
│ Name │ Location │ Version │ Status │ URL │ Port │ Process Manager │
├─────────────┼──────────────┼─────────┼─────────┼─────┼──────┼─────────────────┤
│ ghost-local │ ~/ghost-dev │ 5.129.1 │ stopped │ n/a │ n/a │ n/a │
└─────────────┴──────────────┴─────────┴─────────┴─────┴──────┴─────────────────┘Ghost isn't running right now. If it's stopped, start it.
ghost startAfter starting, open http://localhost:2368/ghost/ in Chrome or another browser to go to the admin page.
3. Downloading and Applying the Theme
Ghost ships with the ruby theme built in, but because of a yarn-related issue I decided to download it manually from GitHub.
- Theme repository: https://github.com/TryGhost/Ruby
- Download: see
Instructions > Download this themeon the page
Remove the previously installed default ruby theme, since it can cause confusion.
rm -rf ~/ghost-dev/content/themes/rubyThen, in the Ghost admin page, go toSettings icon > Design > Theme > Upload
and upload the downloaded ZIP file to apply the theme.
4. Moving to the Theme Folder and Setting Up the Dev Environment
cd ~/ghost-dev/content/themes/ruby
yarn installNode.js and yarn must be installed beforehand.
If yarn isn't installed, install it globally.
npm install -g yarnRun the build tool for local development in the theme folder (/ghost-dev/content/themes/ruby):
yarn devThis command reflects changes in real time, and the built result is generated as assets/built/screen.css.
5. Ruby Theme Directory Structure
├── assets
├ ├─ built
├ ├─ css
├ ├─ fonts
├ ├─ images
├ └──js
├── dist
├── node_modules
├── partials
├── author.hbs
├── default.hbs
├── gulpfile.js
├── index.hbs
├── LICENSE
├── page.hbs
├── post.hbs
├── README.MD
└── tag.hbsYou need to edit the CSS files in assets>css. With yarn dev running, editing the CSS files in the assets>css folder automatically merges and minifies them into built's screen.css.
6. Applying the Pretendard Font
Edit the font definition file.
In an IDE like VS Code, open assets/css/general/font.css, delete everything, and add only the following:
@import url("https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/static/pretendard-dynamic-subset.min.css");Open assets/css/general/basics.css, where the font is applied, and change the existing font setting as follows:
--font-sans: Pretendard, -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif;This setting applies globally to every page.
7. Search Crawler Settings (robots.txt)
Create a robots.txt file in the theme's root folder.
User-agent: *
Allow: /
Disallow: /ghost/
Sitemap: https://mangobox.co.kr/sitemap.xml8. Packaging and Uploading the Theme
When you're done, stop yarn dev:
Ctrl + CThen package the theme as a zip file.
yarn zipA packaged theme file is automatically created in the dist folder.
├── assets
├── dist
├ └──ruby.zipUpload this file to the admin page of your live Ghost site and the customizations are applied.
Recommended Dev Tools
These are simple edits, so even a plain text editor works, but using an IDE is recommended for convenience. Typical options:
- VS Code (light and familiar)
- Cursor (a modern AI-based editor)
- WebStorm (a professional IDE from JetBrains)
Wrapping Up
Now I understand the theme's structure, I've changed the font, and I've finished the search settings.
Ghost has a simpler structure than you'd expect, and once you're used to it, it's an easy platform to customize.
It was a good enough start for decorating a blog in my own style.