Add Contact form to your Ghost blog

Ghost does not ship with the functionality of a form so we have to choose a third party service and there is one Formspree. It lets you add forms to a static site which is great since all we need to do is embed an HTML5 form that does not require any coding skill. All you need to do is replace your email address in place of

 <form id="contactform" action="//formspree.io/me@example.com" method="POST"> 
 <input type="text" name="name" placeholder="Your name">
 <input type="email" name="_replyto" placeholder="Your email">
 <textarea name="message" placeholder="Your message"></textarea>
 <input type="submit" value="Send">
 </form>

Once you add this form submit it and it will ask you to verify the setup by sending you mail on that address once verified your form is ready. Thank you for reading, For more posts stay tuned.

Downgrading Ghost

You would have recently noticed the downtime on my website, well it was not a server maintenance day it was me being fed up of the numbers of bugs and other issues I was facing with Ghost version 0.9.0.

In the recent months, I switched to Ghost and the reason was due to the way its interface was and ease of use. Completely designed for content development. It helped me be more productive because I could focus on writing and all I wanted was that. I preferred it because my website has a minimal designed and is oriented towards readers for other types of websites a fully blown CMS is a much better option like WordPress.

I was enjoying every moment of writing in Ghost until 0.6.4. I was aware that it lacked a lot of features that other platforms offered but the fact that I could preview Markdown side by side and have almost complete screen occupied for content writing made me stick with it. It was all perfect until Ghost decided to redesign the admin interface in version 0.7.0 which looked nice. I instantly upgrade to it and started working with it, at first it was nice until I started feeling that the sidebar occupies a lot of space and when set to hide would pop up every time my cursor moved close to the focus area, I could avoid that so I did not care about it and continue to upgrade it with the latest release.

Over time I started discovering that sometimes I typed to search for a blog post with the right post name it would never appear in the search result and at times open the post I was editing earlier that was not related to the search. What I expect was it being fixed in a newer release which never happened it started getting worse.

The admin panel already started loading slower and the login process would take a longer time instead of thing speeding or getting stable newer feature were included in beta that was not at all functional which was most disappointing.

Normally a software or app is supposed to get better more stable in a newer release instead this got slower and start to have more bugs and non-functional beta features.

All the beta features are supposed to be functional and not to be part of the app as a dummy.

I got annoyed and switch to version 0.6.4 which is faster and feels nicer.

Thank you for reading,

for more posts stay tuned.

Live Tile on Ghost

Microsoft Edge and Internet Explorer 11 support live tile in Windows 8/8.1 and 10. This means any user/visitor who pinned your website or web application to their Start can receive notification on an update like publishing new posts and pages. It is driven with the help of RSS feed, the polling or updating of the tile happens every 30 minutes, you can get this working with your Ghost blog by simply adding this line in your themes head tag which in most themes is located in default.hbs

After adding this meta restart Ghost, if everything goes right you should able to pin your Ghost blog to you start and see it display your latest post and update on the new post being published. Thank you for reading,

Ghost Material(Ghost)

[Loading…](https://gumroad.com/l/ghost-material)

Ghost Material is a clean, simple responsive and snappy theme for Ghost blogging platform built with Google’s Material Design library.

It supports devices of all screen sizes and live tile update for Windows 8/8.1 and 10 for users who use Microsoft Edge and IE.

Works with any version of Ghost above 0.6.x

All of that just for $5

Any questions about this product are welcomed, just leave a comment below.

Ghost on Pi

Ghost is open source blogging platform written in Node.js that offers self hosting and hosted service.

We are going to self host Ghost on a Raspberry Pi.

This guide will take you through the steps of setting up a self hosted Ghost production environment.

I am working on this setup with a clean install of Raspbian and headless setup, you can lean how to enable SSH from here.

You can SSH into your Raspberry Pi(Mac/Linux). If you are a Windows user you need to use Putty

ssh pi@the-ip-address-of-the-pi  

The default username and password of the Raspbian install is.

user: pi

password: raspberry

Installing Node.js

Downloading Node.js(NPM ships with it)

wget http://node-arm.herokuapp.com/node_latest_armhf.deb  

Installing Node.js(required by Ghost)

sudo dpkg -i node_latest_armhf.deb  

Installing Sqlite required by Ghost.

sudo apt-get install sqlite3  

Installing NGINX(used to reverse proxy Ghost)

sudo apt-get install nginx-full  

Installing Supervisor(to manage Ghost)

sudo apt-get install supervisor  

Ghost setup

This will download the latest version of Ghost.

wget https://ghost.org/zip/ghost-latest.zip  

Unzipping the folder we just downloaded.

unzip ghost-latest.zip -d Ghost  

Set Ghost/ as the current directory

cd Ghost/  

Installing dependencies used by Ghost using NPM.

npm install --production  

Run the command below to see everything works fine.

npm start --production  

Time to setup turn Ghost into a service.

Creating the ghost.conf file for Supervisor to manage Ghost.

touch /etc/supervisor/conf.d/ghost.conf  

Editing the file, you can choose any editor you like.

nano /etc/supervisor/conf.d/ghost.conf  

Add these lines to the ghost.conf file.

[program:ghost]  
command = npm start --production  
directory = /home/pi/Ghost/  
user = pi  
autostart = true  
autorestart = true  
stdout_logfile = /var/log/supervisor/ghost.log  
stderr_logfile = /var/log/supervisor/ghost_err.log  
environment = NODE_ENV="production"  

Now save the file, in nano CTRL + X + Y.

You can start Supervisor, if it did not start after installing.

service supervisord start  

Now set Supervisor to run on startup.

sudo update-rc.d supervisord defaults  

Starting Ghost service we just created.

sudo supervisord start ghost  

Ghost will be running in production in port 2368.

Reverse proxying Ghost with NGINX.

Editing the default file.

nano /etc/nginx/sites-enabled/default  

Add these lines

server {  
        listen 80; 
        server_name yourdomain.com; # Change this to your hostname

        location / {
        proxy_pass       http://127.0.0.1:2368;
        proxy_set_header Host      $host;
        proxy_set_header X-Real-IP $remote_addr;
        }

    }

Save the file

Now restart NGINX.

service nginx restart  

Now visit your Raspberry Pi ip address. You will be presented with a beautiful setup screen.

You can edit the Ghost hostname and other settings by editing the config.js stored in the Ghost folder.

Services like DynDNS can be used to manage hostname, if you want your Ghost blog to be public and use a domain name instead of the ip address.

If you have any questions or problem, leave a comment below.

So Clean

I created a clean and simple theme for Ghost blogging platform, here are a few screenshots.

So Clean home page

So Clean article page

You can install it by downloading the zip and placing the folder in.

/content/themes/

You have to restart Ghost and go to the settings panel and choose So Clean as the theme.

If you find a bug in the theme, please report here.

Disable wp-admin redirect in Ghost

Ghost by default has redirect settings, so WordPress users who have migrated to Ghost, can visit the same old /wp-admin url and get redirected to the /ghost url, to access the Ghost Admin.

This is a useful functionality for users who have migrated to Ghost, who didn’t have knowledge that Ghost uses /ghost instead of /wp-admin.

Some user would like to disable this feature, due to various reasons.

This can be done by editing the /core/server/routes/frontend.js file and changing the following lines.

From.

router.get(/^/((ghost-admin|admin|wp-admin|dashboard|signin|login)/?)$/, function (req, res) {  
        /*jslint unparam:true*/
        res.redirect(subdir + '/ghost/');
});

Remove wp-admin, the changes should look like:

router.get(/^/((ghost-admin|admin|dashboard|signin|login)/?)$/, function (req, res) {  
        /*jslint unparam:true*/
        res.redirect(subdir + '/ghost/');
});

Save the file.

Now restart Ghost, now Ghost will not redirect when you visit wp-admin, it will instead display 404 page.

Happy Blogging.

Have a question? leave a comment below.