Sapphire
Ghost theme
Last updated
Was this helpful?
Ghost theme
Last updated
Was this helpful?
Sapphire is a Ghost theme most suitable for building niche publications and personal websites. You can use this theme to show your work, run a blog, build premium memberships for your audience and share what you do.
Demo:
The first step is to unzip the downloaded package. Inside the new directory sapphire, you'll find the zipped theme and a documentation file.
Follow these steps to upload the theme to Ghost:
Login to your ghost admin dashboard (example.com/ghost).
Click the settings icon at the bottom of the left-hand side.
Go to Themes and click Upload a theme.
Select the theme file.
Once uploaded, click on Activate now button to activate the theme immediately or Close if you want to activate it later.
The theme uses and for development purposes. You'll need Node.js v12.x.x
or v14.x.x
installed on your machine. (If you're on a different version of Node, we recommend using NVM to manage multiple versions of Nodejs and set the correct one for developing this theme).
Now you can edit the SCSS and JS files in /assets/sass/
& /assets/js/
directories. These will get compiled to /assets/built/
automatically.
To generate a production-ready theme zip file, run the following command. It will minify all the CSS & JS files and package the theme into dist/<theme-name>-<version>.zip
.
The configuration for LiveReload has already been done in the theme Gulpfile. You can install this chrome plugin and activate it to make your development easier.
All the colors and fonts are managed through CSS variables. You can change colors and fonts by editing the /assets/sass/base/_variables.scss
file.
This file contains variables for primary color, text colors, background color, and primary & secondary fonts.
Sapphire has two options in-built for adding search:
Follow these steps to activate search:
Step 1: Enable the search icon
Edit partials/header.hbs
file and un-comment the search icon as shown in the screenshots:
This was the common step. Based on which search service you want to use, you can follow the steps below.
This is the easiest and free option available for adding search to Ghost blogs.
Steps:
Create a new search engine and copy the embeddable code.
Edit the partials/search.hbs
file and paste the code in the space provided for it.
4. Next, In the GPSE settings set the layout to full width
That's it. You can now check the search on your Ghost blog.
Steps to add ghostHunter:
Edit default.hbs
and un-comment the ghostHunter section at the bottom.
2. Edit partials/search.hbs
and un-comment the ghostHunter section.
3. Create a new integration on your Ghost admin panel, and copy the content API key displayed.
4. Visit Code Injection on your Ghost admin panel, and paste the following snippet in the Page Header section. Update the ghosthunter_key variable with the content API key obtained in last step.
Done. You should see a functional search on your site.
Sapphire theme comes with three color modes – "Light", "Dark", "Warm", which users can change by clicking the color modes icon on the bottom left-hand side.
Light mode is the default for the theme, but you can change the defaults by making the following changes:
Edit default.hbs
and add class color-scheme--dark
or color-scheme--warm
to the HTML tag as shown below.
Edit assets/js/main.js
and change the colorSchemes
array according to the sequence of color schemes that users will see.
3. Recompile the theme (Follow theme development steps for recompiling)
Look for the following space in the post.hbs
file:
Create a Disqus account and retrieve embed code for your site. Paste the embed code inside the space left for it as shown below.
Twitter, Facebook, and RSS feed icon are already implemented in the theme. To add more icons follow these steps:
In partials/icons/
paste SVG file and change its extension to .hbs (instead of .svg)
For example, you created a file called partials/icons/pinterest.hbs
, It should look like this:
Next, edit partials/social-media-icons.hbs
and add the icon
The theme is translation ready and includes translation files for English (en) and German (de). To add a translation for any other language, create the translation file in locales/
directory.
To add a new language, follow these steps:
Copy the en.json
file content into your new file and start to translate each line. The key is plain English that exists in all translation files and should not be changed. You should change only the value.
To set the language in Ghost, Go to Admin > General > PUBLICATION INFO > Publication Language and enter the language code (es
in this example).
To add the custom bio section in the header, follow these steps:
Edit partials/header.hbs
file and uncomment the {{!-- {{> "header-bio"}} --}}
line as shown in screenshot:
2. edit partials/header-bio.hbs
and change the slug author's slug as shown in screenshots:
3. Zip the theme folder, and upload it to your Ghost installation.
Make sure you have at least one post by this author. Ghost sends 404 when there are no posts by the author. The bio section won't display anything if the author has no published posts.
You can add buttons to your blog post content. There are two styles available –
Primary Button: Class name .button--primary
Secondary Button: Class name .button--secondary
To add a button, click the "+" icon next to the line in Ghost editor and select HTML. Then add anchor tags with the class of the button you want to use. For example, to add a primary button you would paste the following HTML:
If you're using a logo on your Ghost blog, then you can follow these steps to customize the height of the logo. By default, we have set the height of the logo to 55 pixels (and 45px for mobile), which works well for most logos, but you might want to customize this setting depending upon your logo.
First, make sure there is no empty padding around your logo's image file. If there is padding around your logo, then you can crop that using any of the image editors.
Next, on your Ghost dashboard go to Settings > Code Injection, and paste the following snippet of CSS code in the Site Header section.
3. Edit the values of max-height property according to your needs. You can change these values and experiment with them to see what works for you.
Note: You can make this change directly in CSS files as well, but this is easier because you won't have to make these changes again when any new update is released on the theme.
To remove the "Published with Ghost & Sapphire" text from the footer, you can edit partials/footer.hbs
file and delete the lines (12-14) containing this text.
To add a tags list view follow these steps:
Create a new page. You can set the title to anything you want. We'll call it Topics.
Next, select the template to "Tags" and save the page.
Done. You can now visit this page to see all your tags rendered in descending order of the number of posts associated with them.
To add a posts archive view, follow these steps:
Create a page. You can set the title to anything you want.
Next, from the settings menu, set the template to "Posts Archive" and save the page.
That's it. You can now visit that page to view your posts archive.
Pro Tip: You can add the Featured Image and Excerpt as well to show them on this view.
Keeping your theme updated with its latest releases can be a little challenging if you have lots of customizations. We would recommend the following ways:
Use Git version control. You can create two branches. One will have your customized theme and one will have the original theme. When an update is released, you can commit the update to the original branch. Then you would switch over to your customization branch and rebase it with the original branch.
Another good practice is to keep third-party scripts like Google Analytics in code injection.
Thanks to the following services and libraries used in building this theme:
Thanks so much!
Once you have Node.js and ready on your machine, run the following commands from the theme root directory:
chrome plugin watches over the handlebars, CSS, SCSS, and JS files and automatically reloads the browser while developing the theme.
After making the required changes, you'll have to re-compile the theme. This can be done by running the npm run build
command. This will generate the zip file. Follow the for more details on compiling the theme.
by Google
search
You can explore other options as well from .
Create an account on .
By default, Google will show ads on top of the search results for free accounts. You can disable that by adding a .
is a Lunr.js based search engine. It is completely free and open-source.
The theme supports comments from services like , , etc.
Download SVG of the icon from .
Create a new file in the theme’s locales
folder with the language code. So, if the new language is Spanish, the new file name will be es.json
.
Check out the to see how buttons look.
Another choice is to manually apply the updates to files changed from the .
for stock images on demo site.
for fonts.
for code highlighting.
for social media brand icons.
for utility icons.
Thank you for using our themes. If you have any questions that are beyond the scope of this documentation, please feel free to email us at . We'll do our best to assist you.