Aspire Documentation
Current Version:1.5.8 - 24 September 2020
Changelog →
👋 Theme Editing & Tools
Edit the theme files mentioned here with your text editor of choice. For example, you can use Visual Studio Code ↗ or Sublime Text ↗.
Once you finish making your changes, zip the theme files, and upload the final zip file to your Ghost website.
Watch the following short video for a quick tutorial.
Are you looking for Ghost hosting? I recommend Ghost(Pro) ↗.
Table of Contents
- Theme Installation
- Upload the routes.yaml File (Required)
- Create a New Content API Key (Required)
- Members / Subscriptions
- Navigation
- Search
- Tags Page
- Disqus
- Advertise Widget
- Posts Per Page
- Related Posts
- Google Analytics
- Update Favicon
- Social Sharing Icons
- Social Media Icons
- Theme Translation
- Theme Deploy with GitHub Actions
- Theme Development
- Theme Update
Theme Installation
The first step is to unzip the downloaded package. Inside the new directory aspire
, you will find the zipped theme and a documentation file. Follow these steps to upload the theme to your blog:
- Log in to your Ghost website admin (example.com/ghost).
- Click Design in the left-side menu.
- Scroll down to the INSTALLED THEMES section.
- Click Upload a theme.
- Select the theme file (aspire.zip).
- Once uploaded, click Activate now to activate the theme immediately. If you want to activate it later, click Close.
Upload the routes.yaml File (Required)
The routes.yaml
file is required for member sign up, and subscription flows.
To upload the file, follow these steps:
- Unzip the
aspire.zip
theme file. - Go to the Labs page in Ghost admin (
/#/settings/labs
). - Scroll down to the Routes section and click the Upload routes YAML button.
- Select and upload the
routes.yaml
file inside the theme zip file.
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’s zip file.
Create a New Content API Key (Required)
To enable certain features, like Search, you’ll need to create a new Content API Key. Follow these steps to create your key.
In the left-side menu of your Ghost admin, click Integrations then + Add custom integration.
Give the new integration a name, like “Search”, and click Create.
A new content API Key will be created. When you hover over it, a Copy button will appear. Click the button to copy the key to the clipboard.
Next, click Code injection from the left-side admin menu.
After replacing the API_KEY
value with your API Key, add the following code to the Site Header box:
<script>
var search_api_key = 'API_KEY';
</script>
It should look like this:
Click Save.
Members / Subscriptions
Enable subscribers by checking the Enable members checkbox on the Labs page in your Ghost admin panel.
Once you enabled this feature, different parts of the theme will appear:
- Login In and Subscribe links in the sidebar.
- Footer subscription forms
- Sidebar subscription form
- Article subscription form after content
Edit Plan Features
To edit plan features, edit the partials/signup-plans.hbs
file.
Remove ‘Log in’ and ‘Subscribe’ from Header
To remove Log in and Subscribe from the header, open the partials/header.hbs
file and remove lines 28
to 36
. This will also remove the Account and Logout links.
Membership Troubleshooting Tips
If for any reason the subscribe form does not work, or there is an error message, the following tips might help:
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://
..
For more information about Members, connecting Stripe, and setting the package price, check the official Ghost documentation.
Navigation
You can add, edit, delete, and reorder menu links on your Ghost blog in the NAVIGATION section (Admin > Settings > Design).
To include a static page on your navigation menu, follow these steps.
First, type the page’s name as you’d like it appear on your menu in the label field.
Next, click on the item’s URL. The blog URL will already be auto-populated. Add the page slug after the final /. When you’re satisfied with your page configurations, click the blue Save button to add the page to the navigation menu.
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 theme partials/footer.hbs
file and replace line 6
with the following line.
{{ navigation type='secondary' }}
That’s all you need to do.
Search
For the search to work, please make sure to Create a New Content API Key.
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 above.
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.
Disqus
To enable Disqus as a comments system, open the partials/disqus.hbs
file. 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';
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
file and comment or delete the line containing the {{> disqus}}
text (line 93
).
Disable Disqus Recommendations
Checkout the Disqus Recommendations documentation.
To set up the Twitter feed:
- Go to publish.twitter.com.
- Enter a Twitter URL into the input box and press Enter.
- Select Embedded Timeline.
- You will see a Timeline preview and you can customize it as required.
- Copy the code by clicking the Copy Code button.
- Open
partials/sidebar/widget-twitter.hbs
file and replace line 4 with the copied code. - Save and you are done.
Advertise Widget
If you want to add an advertisement widget to your sidebar, this widget is the way to go. This will enable you to add an image and a URL associated with it, all you need to do is:
- Replace your custom image with the image located in the theme directory (
assets/images/ads.jpg
). - Update
partials/sidebar/widget-ads.hbs
file with the URL (href
) value. - Add an alternative text to the image (
alt
value) like the following image.
If you want to remove the Advertise Widget, you can remove or comment the {{> sidebar/widget-ads}}
line inside the partials/sidebar.hbs
file.
Posts Per Page
You can control how many posts display per 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
If other posts share the same tags, related posts will be visible at the bottom of a post.
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.
–
Social Sharing Icons
You can customize and update a post’s social media sharing icons from the partials/share.hbs
theme file.
Social Media Icons
Social media icons are placed in 3 different places (files):
partials/footer.hbs
partials/social-nav.hbs
partials/sidebar/widget-social.hbs
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.
For other social accounts, the theme uses Evil Icons to provide simple and clean icons. 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-nav__item'>
<a href='#' aria-label='Instagram' target='_blank' rel='noopener'>
<span class='c-social-nav__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-nav__item'>
<a href='https://www.instagram.com/ghost/' aria-label='Instagram' target='_blank' rel='noopener'>
<span class='c-social-nav__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.
This concept is applied to all the custom icon list available in the 3 social media places.
Update Favicon
You can change the favicon in Ghost from Admin > General > PUBLICATION IDENTITY > Publication icon.
Languages
Aspire ships with many languages already. But if you’d like to add another one, you’ll be able to do that too.
Theme Translation
Aspire supports Ghost i18n and comes with German, Italian, Spanish, French, Finnish, Portuguese Dutch, Turkish, and Danish translations.
To use a language other than English, go to Admin > General > PUBLICATION INFO > Publication Language and enter the ISO Code.
da
for Danishde
for Germanydu
for Dutchen
for Englishes
for Spanishfi
for Finnishfr
for Frenchit
for Italianpt
for Portuguesetr
for Turkish
Add a New Language
To add a new language, follow these steps.
- Create a new file in the theme’s
locales
folder with the language ISO Code code. So, if the new language is Arabic, the new file name will bear.json
. - Copy the
en.json
file content into your new file and start to translate, as shown in the following section. - Go to Admin > General > PUBLICATION INFO > Publication Language and enter the language code (
ar
in this example).
Edit a Translation
To improve or edit a translation in a specific available language, you can open the language file in the locales
folder:
|____locales
| |____da.json
| |____de.json
| |____du.json
| |____en.json
| |____es.json
| |____fi.json
| |____fr.json
| |____it.json
| |____pt.json
| |____tr.json
For example, the German translation file looks like this:
{
"Next": "Weiter",
"Previous": "Zurück",
" (Page %)": " (Seite %)",
"Page Not Found": "Seite nicht gefunden",
"Recent Posts": "kürzliche Artikel",
"Home Page": "Startseite",
"Featured Post": "Featured Artikel",
"Share on Twitter": "Auf Twitter teilen",
"Share on Facebook": "Auf Facebook teilen",
"Share on Pinterest": "Auf Pinterest teilen",
"Search": "Suche",
"Search {blogtitle}": "Suche {blogtitle}",
"Type to Search": "Tippe um zu suchen",
"Published with {ghostLink} & {themeLink}": "Veröffentlicht mit {ghostLink} & {themeLink}",
"You Might Be Interested In": "Sie könnten daran interessiert sein",
"Newsletter": "Newsletter",
"Follow": "Folgen",
"Email": "E-Mail",
"Account": "Konto",
"Log In": "Einloggen",
"Log Out": "Ausloggen",
"Continue": "Fortsetzen",
"Subscribe": "Abonnieren",
"Subscribe Now": "Abonniere jetzt",
"Enter your email below to join our newsletter": "Geben Sie Ihre E-Mail-Adresse unten ein, um unserem Newsletter beizutreten",
"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.",
"You've successfully subscribed to {siteTitle}": "Sie haben {siteTitle} erfolgreich abonniert.",
"Great! Next, complete checkout for full access to {siteTitle}": "Toll! Schließen Sie als Nächstes die Prüfung ab, um vollen Zugriff auf {siteTitle} zu erhalten.",
"Welcome back! You've successfully signed in.": "Willkommen zurück! Sie haben sich erfolgreich angemeldet.",
"Success! Your account is fully activated, you now have access to all content.": "Erfolg! Ihr Konto ist vollständig aktiviert, Sie haben nun Zugriff auf alle Inhalte.",
"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",
"Choose your subscription": "Wählen Sie Ihr Abonnement",
"Unlock full access to {siteTitle} and see the entire library of members-only content & updates.": "Schalte den vollen Zugriff auf {siteTitle} frei und sieh dir die gesamte Bibliothek mit Inhalten und Updates nur für Mitglieder an.",
"Subscribe to {siteTitle}": "Abonnieren bei {siteTitle}",
"Welcome back!": "Willkommen zurück!",
"Log Into your account again.": "Melden Sie sich erneut in Ihrem Konto an.",
"Send login link": "Anmeldelink senden",
"Nice, you're a subscriber!": "Schön, dass Sie Abonnent sind!",
"You have an active {siteTitle} account with access to all posts.": "Sie haben ein aktives {siteTitle} Konto mit Zugriff auf alle Posts.",
"You're a subscriber to free members updates": "Sie sind Abonnent der kostenlosen Mitgliederaktualisierungen",
"You are subscribed to free updates from {siteTitle}, but don't have a paid subscription to read all the posts.": "Sie haben kostenlose Updates von {siteTitle} abonniert, haben jedoch kein kostenpflichtiges Abonnement, um alle Beiträge zu lesen."
}
Each line consists of a left key ("Next"
) and a right value ("Weiter"
).
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.
Theme Deploy with GitHub Actions
Aspire Documentation comes integrated with the Deploy Ghost Theme ↗ Github action.
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.
Theme Development
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.
Note
Changing any hbs
file, for example, the post.hbs
file does not require being in development mode with gulp running. Just edit the file in your preferred editor and upload it.
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 filepartials/compiled/inline-css.hbs
: The final CSS file
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
v10.16.0
$ npm -v
6.14.8
$ bower -v
1.8.8
$ gulp -v
CLI version: 2.2.0
Local version: 4.0.2
This environment works well for running Ghost and also for theme development.
I use macOS Big Sur.
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.
Zip Theme Files
To create a zip file after your theme changes, you can use one of the following options.
Use one of the first two options if you are on a Theme Development mode.
1. Using the command line
zip -r aspire.zip aspire -x '*node_modules*' '*bower_components*'
This will exclude the node_modules and bower_components directories from the final zip file.
2. Using Gulp
If you are running gulp, you can type the gulp zip
command to do this.
3. 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 it to view the context menu. Then, click the “Compress” option.
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.
