• jmtalarn.com

    The site home index page.

  • Web dev notes

    Web Dev Notes: Where I jot down tech insights, resources on technology and web development and handy tips to remember.

  • CV

    Explore my CV to learn about my background, experience, education, certifications, and projects.

Upgrade Ghost blog to 0.11.0 on Openshift platform

ghost, blog, openshift
Blogging, Web development
30, September 2016

I installed Ghost as my blogging platform some time ago and I have been updating it for each Ghost update. All this is running and hosted by the RedHat OpenShift platform.

You can check how I've a Node.js Express App alive together with my blog in this post Express app and a Ghost blog together.

AMP available for Ghost blog posts

With the latest version available I noticed a very interesting feature for me: the automatic render of Accelerated Mobile Pages (AMP) version of the blog posts, speeding up the load times on mobile devices. And all this, looking handsome and sexy to Google's eyes!

Basically you need to add an amp.hbs template to your theme and follow the rules and recommendations to build AMP pages.

Here is full information about AMP support for your Ghost themes http://themes.ghost.org/v0.10.0/docs/amp

Updating Ghost on Openshift

In order to update you should modify your package.json file in your project to use the new version of Ghost NPM module (^0.11.0).

You also should modify the node value in engines section to use the newest compatible node version and recommended by Ghost team (~4.2).

{
"name": "openshift-ghost-quickstart",
"description": "Openshift Ghost Quickstart (SQLite)",
"repository": {
"type": "git",
"url": "git://github.com/openshift-quickstart/openshift-ghost-quickstart.git"
},
"bugs": "https://github.com/openshift-quickstart/openshift-ghost-quickstart/issues",
"main": "index.js",
"scripts": {
"start": "node index"
},
"engines": {
"node": "~4.2.0"
},
"engineStrict": true,
"dependencies": {
"express": "^4.13.3",
"ghost": "^0.11.0"
}
}

ENOSPC error when upgrading

Maybe if you are on the free gears layer you'll must clean and tidy your space to prevent a Not Enough Space error, also known as ENOSPC error.

You should run the command using the openshift command line client rhc.

rhc app tidy ghost

You can also run with dependencies errors. You should connect via ssh to your app host

rhc ssh app YOURAPP

And remove node_modules folder, clean the node packages cache and reinstall the packages:

rm -rf node\_modules && npm cache clear && npm install --production.

You can check the latest Ghost blog version updates on its blog https://dev.ghost.org/ghost-0-11-0/

Blog post