|Summary=Ghost allows you to write and publish your own blog, giving you the tools to make it easy and even fun to do.

+

|CatPkg=www-apps/ghost

+

|Maintainer=anak1n

+

|Homepage=https://ghost.org

+

}}

+

=== Description ===

+

Ghost is an easy to use, quick, and light blogging platform that uses nodejs and is ready to go in minutes. You can configure it to do anything from a self hosted blog for yourself, a blog that uses multiple users with their own usernames and profile pages.

+

+

=== Configuring Ghost ===

+

To use Ghost in production (as opposed to development mode) you simply first run:

+

+

{{console|body=

+

###i## emerge ghost

+

###i## npm install --production

+

}}

+

+

Then configure your options in {{f|/usr/share/webapps/ghost/config.example.js}} and rename it to {{f|/usr/share/webapps/ghost/config.js}}:

+

{{file|name=config.js|lang=javascript|desc=ghost config|body=

+

// # Ghost Configuration

+

// Setup your Ghost install for various environments

+

// Documentation can be found at http://support.ghost.org/config/

+

+

var path = require('path'),

+

config;

+

+

config = {

+

// ### Production

+

// When running Ghost in the wild, use the production environment

+

// Configure your URL and mail settings here

+

production: {

+

url: 'http://blog.somedomain.com',

+

mail: {

+

transport: 'SMTP',

+

options: {

+

service: 'Gmail',

+

auth: {

+

user: 'user@gmail.com',

+

pass: 'password'

+

}

+

}

+

},

+

database: {

+

client: 'sqlite3',

+

connection: {

+

filename: path.join(__dirname, '/content/data/ghost.db')

+

},

+

debug: false

+

},

+

+

server: {

+

// Host to be passed to node's `net.Server#listen()`

+

host: '0.0.0.0',

+

// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`

+

port: '2368'

+

}

+

}

+

};

+

+

// Export config

+

module.exports = config;

+

}}

+

+

{{note|You don't need to use Gmail as your mail, just an example. E-mail is only used for when you add users to the blog, it sends a notice so they can set up their own username and their own password, or if you forget your password and need to reset.}}

+

+

After you've completed setting up your {{f|config.js}}, you can start Ghost from:

+

+

{{console|body=

+

###i## npm start --production

+

}}

+

+

Once you confirm that it has started, you use the URL and port you provided in your browser: {{c|blog.somedomain.com:2368/ghost/signup}}

+

+

If you use Gravatar and use the e-mail used for that, it will automatically enable your Gravatar as your users avatar. You can disable this if you'd like by adding the following to your config.js

+

+

{{file|name=config.js|lang=javascript|desc=ghost config|body=

+

privacy: {

+

useGravatar: false

+

}

+

}}

+

+

If you'd like to add SSL support for your blog, you can do so in {{f|config.js}}:

+

{{file|name=config.js|lang=javascript|desc=ghost config|body=

+

...

+

url: 'http://blog.somedomain.com',

+

urlSSL: 'https://secure.myblog.com'

+

...

+

}}

+

+

After this is all done, you can start using your blog. To use it you go to the domain your provided in {{c|config.js}}: {{c|blog.somedomain.com:2368/ghost}} and you will be able to publish, write drafts, and edit any posts.

+

+

=== Themes, adding Disqus and Google Analytics ===

+

{{important|After changing any of the {{c|*.hbs}} files you need to restart your blogs instance.}}

+

The default theme for Ghost is called {{c|Casper}} which is located in {{f|/usr/share/webapps/ghost/content/themes/}}. If you'd like to keep this them and edit it, it is recommended that you copy it to a different name, to change the name for picking in the theme section of the Ghost admin page, edit {{f|/usr/share/webapps/ghost/content/themes/my-theme/package.json}}:

+

{{file|name=package.json|desc=theme|body=

+

{

+

"name": "My Theme,

+

"version": "1"

+

}

+

}}

+

+

The file to edit for the CSS of your default theme would be in {{f|/usr/share/webapps/ghost/content/themes/my-theme/assets/css/}}.

You may edit as much as you'd like in this file, though if you add new a new {{c|div}} for the main page you'll have to make sure to add it in {{f|/usr/share/webapps/ghost/content/themes/my-theme/default.hbs}}.

+

+

You may also get some free themes from the [http://marketplace.ghost.org/themes/free/ Ghost Marketplace].

+

+

==== Adding Disqus ====

+

[https://disqus.com/ Disqus] is a great way to keep in contact with your readers via comments. It is suggested that you add it to your blog if you'd like feedback on your posts, or just would like to stay in contact with your readers. This is not required, though.

+

+

In order to add Disqus, you'll need to sign up at their website, then grab the code. It will be labeled as 'Universal code' on your Disqus homepage. You must then add this code to {{f|/usr/share/webapps/ghost/content/themes/(theme name)/post.hbs}}. This will be pasted anywhere between {{c|<nowiki>{{/post}}</nowiki>}} and {{c|</article>}}.

If you track the traffic to your blog and use Google Analytics, you simply need to edit your {{f|/usr/share/webapps/ghost/content/(theme name)/default.hbs}} and add the code in between the {{c|<head>}} and {{c|</head>}}.

Ghost (Blogging Platform)

Description

Ghost is an easy to use, quick, and light blogging platform that uses nodejs and is ready to go in minutes. You can configure it to do anything from a self hosted blog for yourself, a blog that uses multiple users with their own usernames and profile pages.

Configuring Ghost

To use Ghost in production (as opposed to development mode) you simply first run:

# emerge ghost
# npm install --production

Then configure your options in /usr/share/webapps/ghost/config.example.js and rename it to /usr/share/webapps/ghost/config.js:

You don't need to use Gmail as your mail, just an example. E-mail is only used for when you add users to the blog, it sends a notice so they can set up their own username and their own password, or if you forget your password and need to reset.

After you've completed setting up your config.js, you can start Ghost from:

# npm start --production

Once you confirm that it has started, you use the URL and port you provided in your browser: blog.somedomain.com:2368/ghost/signup

If you use Gravatar and use the e-mail used for that, it will automatically enable your Gravatar as your users avatar. You can disable this if you'd like by adding the following to your config.js

config.js (javascript source code) - ghost config

privacy:{
useGravatar:false}

If you'd like to add SSL support for your blog, you can do so in config.js:

After this is all done, you can start using your blog. To use it you go to the domain your provided in config.js: blog.somedomain.com:2368/ghost and you will be able to publish, write drafts, and edit any posts.

Themes, adding Disqus and Google Analytics

Important

After changing any of the *.hbs files you need to restart your blogs instance.

The default theme for Ghost is called Casper which is located in /usr/share/webapps/ghost/content/themes/. If you'd like to keep this them and edit it, it is recommended that you copy it to a different name, to change the name for picking in the theme section of the Ghost admin page, edit /usr/share/webapps/ghost/content/themes/my-theme/package.json:

package.json - theme

{
"name": "My Theme,
"version": "1"
}

The file to edit for the CSS of your default theme would be in /usr/share/webapps/ghost/content/themes/my-theme/assets/css/.

Adding Disqus

Disqus is a great way to keep in contact with your readers via comments. It is suggested that you add it to your blog if you'd like feedback on your posts, or just would like to stay in contact with your readers. This is not required, though.

In order to add Disqus, you'll need to sign up at their website, then grab the code. It will be labeled as 'Universal code' on your Disqus homepage. You must then add this code to /usr/share/webapps/ghost/content/themes/(theme name)/post.hbs. This will be pasted anywhere between {{/post}} and </article>.

Adding Google Analytics

If you track the traffic to your blog and use Google Analytics, you simply need to edit your /usr/share/webapps/ghost/content/(theme name)/default.hbs and add the code in between the <head> and </head>.