Difference between pages "Funtoo Profiles" and "Package:Ghost (Blogging Platform)"

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
m (link to make.conf)
 
 
Line 1: Line 1:
== What is a profile? ==
{{Ebuild
|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.


In Gentoo and Funtoo Linux, profiles are used to define base system settings, and have historically had a lot of untapped potential. In Funtoo Linux, I wanted to take advantage of some of this potential to allow Funtoo Linux users to easily tailor their system for various types of roles. Enter the new Funtoo profile system.
=== Configuring Ghost ===
To use Ghost in production (as opposed to development mode) you simply first run:


== What It Is ==
{{console|body=
###i## emerge ghost
###i## npm install --production
}}


Historically, users have had to add a ton of settings to <code>/etc/[[make.conf]]</code> to customize their Gentoo or Funtoo Linux system, which made setup of the operating system more difficult than it should be.
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/


In Gentoo Linux, it is possible to only define one ''system profile''. Think of a system profile as the default settings that Portage uses for building everything on your system.
var path = require('path'),
    config;


In Funtoo Linux, multiple profiles can be enabled at the same time. These include:
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
        },


* '''arch''' - one arch profile is enabled, at build time, and is not changed. This defines CPU architecture-specific settings.
        server: {
* '''build''' - one build profile is enabled, at build time, and is generally not changed. It defines the type of build, such as 'current' or 'stable', and associated settings.
            // Host to be passed to node's `net.Server#listen()`
* '''flavor''' - one flavor is enabled per system, and can be changed by the user. This defines the general use of the system, such as 'minimal', 'core', 'workstation' or 'desktop'
            host: '0.0.0.0',
* '''mix-in''' - zero or more mix-ins can be enabled that enable settings specific to a particular subset of features, such as 'gnome', 'kde', 'media', 'mate', 'X', 'hardened'
            // Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
            port: '2368'
        }
    }
};


{{Fancynote|1=
// Export config
See [[Flavors and Mix-ins]] for a complete list of all flavors and mix-ins available in Funtoo Linux, along with descriptions of what each one does.}}
module.exports = config;
}}  


=== Origins and Benefits ===
{{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.}}


This new system is really a completion of the original cascading profile design that was designed by Daniel Robbins and implemented by Seemant Kulleen as part of Portage. Funtoo Profiles designed to leverage the existing cascading profile system and provide something much more useable and maintainable for users and developers alike. Here are some of its benefits:
After you've completed setting up your {{f|config.js}}, you can start Ghost from:


* Fewer settings in <code>/etc/make.conf</code>. <code>CHOST</code> and <code>ARCH</code> no longer set in <code>/etc/make.conf</code>.
{{console|body=
* Separation of concerns -- arch, build, and flavor-related settings are organized together.
###i## npm start --production
* User flexibility - any number of mix-ins can be enabled to tweak masks or USE settings as needed.
}}


{{fancynote|See [[Custom Profiles]] for information on how to extend the profile system.}}
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


== Switch to the Funtoo 1.0 Profile ==
{{file|name=config.js|lang=javascript|desc=ghost config|body=
privacy: {
    useGravatar: false
}
}}


=== Using eselect ===
If you'd like to add SSL support for your blog, you can do so in {{f|config.js}}:
The preferred method of adding and removing profiles is to use [[eselect|eselect profile]]. This will ensure that profiles are added correctly and in the proper order. The order is imperative for things to work right.
{{file|name=config.js|lang=javascript|desc=ghost config|body=
...
        url: 'http://blog.somedomain.com',
        urlSSL: 'https://secure.myblog.com'
...
}}


Type the following to view a list of available options for '''eselect profile''':
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.
<console>
###i## eselect profile help
</console>


=== 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"
}
}}


For a start, let's see what the default configuration has to offer. Get an overview using the '''list''' command:
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/}}.  
<console>
{{note|This requires a basic knowledge of CSS}}
###i## eselect profile list
{{console|body=
##b####g##Currently available arch profiles:
###i## cp -r /usr/share/webapps/ghost/content/themes/casper/ /usr/share/webapps/ghost/content/themes/my-theme
  ##b##[1]  funtoo/1.0/linux-gnu/arch/x86-64bit##!b## *
###i## nano -w /usr/share/webapps/ghost/content/themes/my-theme/assets/css/screen.css
  ##b##[2]##!b##  funtoo/1.0/linux-gnu/arch/pure64
}}
##b####g##Currently available build profiles:
  ##b##[3]##!b##  funtoo/1.0/linux-gnu/build/stable
  ##b##[4]  funtoo/1.0/linux-gnu/build/current##!b## *
  ##b##[5]##!b##  funtoo/1.0/linux-gnu/build/experimental
##b####g##Currently available flavor profiles:
  ##b##[6]##!b##  funtoo/1.0/linux-gnu/flavor/minimal
  ##b##[7]  funtoo/1.0/linux-gnu/flavor/core##!b## *
  ##b##[8]##!b##  funtoo/1.0/linux-gnu/flavor/desktop
  ##b##[9]##!b##  funtoo/1.0/linux-gnu/flavor/workstation
  ##b##[10]##!b##  funtoo/1.0/linux-gnu/flavor/hardened
##b####g##Currently available mix-ins profiles:
  ##b##[11]##!b##  funtoo/1.0/linux-gnu/mix-ins/audio
  ##b##[12]##!b##  funtoo/1.0/linux-gnu/mix-ins/cinnamon
  ##b##[13]##!b##  funtoo/1.0/linux-gnu/mix-ins/console-extras
  ##b##[14]##!b##  funtoo/1.0/linux-gnu/mix-ins/dvd
  ##b##[15]##!b##  funtoo/1.0/linux-gnu/mix-ins/gnome
  ##b##[16]##!b##  funtoo/1.0/linux-gnu/mix-ins/kde
  ##b##[17]##!b##  funtoo/1.0/linux-gnu/mix-ins/mate
  ##b##[18]##!b##  funtoo/1.0/linux-gnu/mix-ins/media
  ##b##[19]##!b## funtoo/1.0/linux-gnu/mix-ins/print
  ##b##[20]##!b##  funtoo/1.0/linux-gnu/mix-ins/python3-only
  ##b##[21]##!b##  funtoo/1.0/linux-gnu/mix-ins/rhel5-compat
  ##b##[22]##!b##  funtoo/1.0/linux-gnu/mix-ins/server-db
  ##b##[23]##!b##  funtoo/1.0/linux-gnu/mix-ins/server-mail
  ##b##[24]##!b##  funtoo/1.0/linux-gnu/mix-ins/server-web
  ##b##[25]##!b##  funtoo/1.0/linux-gnu/mix-ins/X
  ##b##[26]##!b##  funtoo/1.0/linux-gnu/mix-ins/xfce
  ##b##[27]##!b##  funtoo/1.0/linux-gnu/mix-ins/vmware-guest
  ##b##[28]##!b##  funtoo/1.0/linux-gnu/mix-ins/hardened
</console>


As in several other Funtoo utilities, a star ('''*''') on the right indicates an active item (your case may differ from the example above).
{{file|name=screen.css|lang=css|desc=ghost theme|body=
In most cases you will want to set your "flavor" first. Remember that you can only set ''one'' flavor at time.
# Changing blockquotes:
blockquote {
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    padding-left:5px;
    padding-top:10px;
    padding-bottom:10px;
    border-left: #fff 3px solid;
    margin:25px;
    line-height:1.3em;
}


To choose your favorite flavor use the '''set-flavor''' command including your selection. In this example, we will set the '''desktop''' flavor:
# Changing preformatted text for source code:
{{Fancynote| You ''must'' use numbers to reference to the profiles you want.}}
pre {
<console>###i## eselect profile set-flavor 8</console>
    -moz-box-sizing: border-box;
View the result:
    box-sizing: border-box;
<console>###i## eselect profile list
    margin: 0 0 1.75em 0;
##b####g##Currently available arch profiles:
    border: #E3EDF3 1px solid;
  ##b##[1]  funtoo/1.0/linux-gnu/arch/x86-64bit##!b## *
    width: 100%;
  ##b##[2]##!b##  funtoo/1.0/linux-gnu/arch/pure64
    padding: 9.5px;
##b####g##Currently available build profiles:
    font-family:'Source Code Pro', monospace;
  ##b##[3]##!b##  funtoo/1.0/linux-gnu/build/stable
    font-size: 13px;
  ##b##[4]  funtoo/1.0/linux-gnu/build/current##!b## *
    white-space: pre;
  ##b##[5]##!b##  funtoo/1.0/linux-gnu/build/experimental
    overflow: auto;
##b####g##Currently available flavor profiles:
    background: #000;
  ##b##[6]##!b##  funtoo/1.0/linux-gnu/flavor/minimal
    border-radius: 6px;
  ##b##[7]##!b##  funtoo/1.0/linux-gnu/flavor/core
    color:#ccc;
  ##b##[8]  funtoo/1.0/linux-gnu/flavor/desktop##!b## *
    word-break:break-all;
  ##b##[9]##!b##  funtoo/1.0/linux-gnu/flavor/workstation
    word-wrap:break-word;
  ##b##[10]##!b## funtoo/1.0/linux-gnu/flavor/hardened
  }
##b####g##Currently available mix-ins profiles:
}}
  ##b##[11]  funtoo/1.0/linux-gnu/mix-ins/audio (auto)
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}}.
  ##b##[12]##!b##  funtoo/1.0/linux-gnu/mix-ins/cinnamon
  ##b##[13]  funtoo/1.0/linux-gnu/mix-ins/console-extras (auto)
  ##b##[14]  funtoo/1.0/linux-gnu/mix-ins/dvd (auto)
  ##b##[15]##!b##  funtoo/1.0/linux-gnu/mix-ins/gnome
  ##b##[16]##!b##  funtoo/1.0/linux-gnu/mix-ins/kde
  ##b##[17]##!b##  funtoo/1.0/linux-gnu/mix-ins/mate
  ##b##[18]  funtoo/1.0/linux-gnu/mix-ins/media (auto)
  ##b##[19]  funtoo/1.0/linux-gnu/mix-ins/print (auto)
  ##b##[20]##!b##  funtoo/1.0/linux-gnu/mix-ins/python3-only
  ##b##[21]##!b## funtoo/1.0/linux-gnu/mix-ins/rhel5-compat
  ##b##[22]##!b##  funtoo/1.0/linux-gnu/mix-ins/server-db
  ##b##[23]##!b##  funtoo/1.0/linux-gnu/mix-ins/server-mail
  ##b##[24]##!b## funtoo/1.0/linux-gnu/mix-ins/server-web
  ##b##[25]  funtoo/1.0/linux-gnu/mix-ins/X (auto)
  ##b##[26]##!b##  funtoo/1.0/linux-gnu/mix-ins/xfce
  ##b##[27]##!b##  funtoo/1.0/linux-gnu/mix-ins/vmware-guest
  ##b##[28]##!b##  funtoo/1.0/linux-gnu/mix-ins/hardened
</console>
As you see by the '''(auto)''' entries, the '''desktop''' flavor already pre-set some mix-ins for you.
 
Now, let's head over and add some mix-ins. To add, say, the mix-ins '''gnome''' and '''kde''' we'd have to enter:
 
<console>
###i## eselect profile add 15
###i## eselect profile add 16
</console>
 
Or, in a one-shot:
 
<console>
###i## eselect profile add 15 16
</console>
 
If we want to remove a mix-in, for example '''gnome''', simply enter:
 
<console>
###i## eselect profile remove 15
</console>
 
Verification:


<console>###i## eselect profile list
You may also get some free themes from the [http://marketplace.ghost.org/themes/free/ Ghost Marketplace].
##b####g##Currently available arch profiles:
  ##b##[1]  funtoo/1.0/linux-gnu/arch/x86-64bit##!b## *
  ##b##[2]##!b##  funtoo/1.0/linux-gnu/arch/pure64
##b####g##Currently available build profiles:
  ##b##[3]##!b##  funtoo/1.0/linux-gnu/build/stable
  ##b##[4]  funtoo/1.0/linux-gnu/build/current##!b## *
  ##b##[5]##!b##  funtoo/1.0/linux-gnu/build/experimental
##b####g##Currently available flavor profiles:
  ##b##[6]##!b##  funtoo/1.0/linux-gnu/flavor/minimal
  ##b##[7]##!b##  funtoo/1.0/linux-gnu/flavor/core
  ##b##[8]  funtoo/1.0/linux-gnu/flavor/desktop##!b## *
  ##b##[9]##!b##  funtoo/1.0/linux-gnu/flavor/workstation
  ##b##[10]##!b##  funtoo/1.0/linux-gnu/flavor/hardened
##b####g##Currently available mix-ins profiles:
  ##b##[11]  funtoo/1.0/linux-gnu/mix-ins/audio (auto)
  ##b##[12]##!b##  funtoo/1.0/linux-gnu/mix-ins/cinnamon
  ##b##[13]  funtoo/1.0/linux-gnu/mix-ins/console-extras (auto)
  ##b##[14]  funtoo/1.0/linux-gnu/mix-ins/dvd (auto)
  ##b##[15]##!b##  funtoo/1.0/linux-gnu/mix-ins/gnome
  ##b##[16]  funtoo/1.0/linux-gnu/mix-ins/kde *
  ##b##[17]##!b##  funtoo/1.0/linux-gnu/mix-ins/mate
  ##b##[18]  funtoo/1.0/linux-gnu/mix-ins/media (auto)
  ##b##[19]  funtoo/1.0/linux-gnu/mix-ins/print (auto)
  ##b##[20]##!b##  funtoo/1.0/linux-gnu/mix-ins/python3-only
  ##b##[21]##!b##  funtoo/1.0/linux-gnu/mix-ins/rhel5-compat
  ##b##[22]##!b##  funtoo/1.0/linux-gnu/mix-ins/server-db
  ##b##[23]##!b##  funtoo/1.0/linux-gnu/mix-ins/server-mail
  ##b##[24]##!b##  funtoo/1.0/linux-gnu/mix-ins/server-web
  ##b##[25]  funtoo/1.0/linux-gnu/mix-ins/X (auto)
  ##b##[26]##!b##  funtoo/1.0/linux-gnu/mix-ins/xfce
  ##b##[27]##!b##  funtoo/1.0/linux-gnu/mix-ins/vmware-guest
  ##b##[28]##!b##  funtoo/1.0/linux-gnu/mix-ins/hardened
</console>


==== 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.


No magic here, whatever you add gets put into the <code>/etc/portage/make.profile/parent</code> file by portage.
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>}}.
{{file|name=post.hbs|lang=javascript|desc=adding Disqus|body=
  </footer>
  <div id="disqus_thread"></div>
  <script type="text/javascript">
    var disqus_shortname = 'example'; // required: replace example with your forum shortname
    var disqus_identifier = '{{post.id}}';


In our case, this file contains:
    /* * * DON'T EDIT BELOW THIS LINE * * */
<console>
    (function() {
###i## cat /etc/portage/make.profile/parent
      var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
gentoo:funtoo/1.0/linux-gnu/arch/x86-64bit
      dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
gentoo:funtoo/1.0/linux-gnu/build/current
      (document.getElementsByTagName('head')[0]  {{!}} {{!}} document.getElementsByTagName('body')[0]).appendChild(dsq);
gentoo:funtoo/1.0/linux-gnu/flavor/desktop
    })();
gentoo:funtoo/1.0/linux-gnu/mix-ins/kde
  </script>
</console>
  <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
{{fancywarning|Please, do not add anything manually into <code>parent</code> file. This may result in profile breakage.}}
  <a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
 
</article>
== For Developers ==
 
=== Define the profile sub-sets you will use ===
 
So far in Funtoo we have used the exact same profiles as Gentoo thus Funtoo/2008.0 was strictly the same thing as Gentoo/2008.0 or the barely the same 10.0. This (monolithic) profile was set though a symbolic link named <code>/etc/make.profile</code> pointing on a complex directory architecture located somewhere under <code>/usr/portage/profiles</code>. This is no longer valid with the Funtoo 1.0 profiles as they are split in several smaller bricks which are then glued together via the  <code>/etc/portage/make.profile/parent</code> file (You do not need to include everything, just use the "bricks" you need). Those bricks belongs to several categories:
 
# MANDATORY -- An "arch" profile which defines settings for a particular architecture. You'll want to set this to whatever arch your system is and leave it alone. '''Setting it to a different arch than your system could severely break it.'''
# MANDATORY -- A "build" profile which should match the tree you wish to use. '''Stable''', '''Current''' (~arch), or '''Experimental''' (use it if you are brave enough and find '''current''' too stable).
# MANDATORY -- A "flavor" profile (what was previously known as ''profiles'' is still known as such in Gentoo) which describes the kind of system you want:
#* minimal - Be warned, minimal is exactly what it says, the minimal profile stuff you need for a usable system, nothing else. This is really for people who know what they're doing.
#* core - This is the core profile. This is for stuff that affects both desktops and servers.
#* desktop - Exactly what it says. If you're using a desktop, you should set this as your flavor.
#* server - If you're running a server, you should set this as your flavor.
# OPTIONAL -- One or more "mix-ins" profiles which describe optional add-ons. 'mix-ins' are the heart of the Funtoo 1.0 profiles. Unlike the monolithic profiles which sets a massive amount of use flags and options for you, we've split them into logical add-on profiles. For instance if you want support for gnome, you would add the gnome mix-in to your current profiles. That mix-in sets all the proper use flags and such for gnome. Same with others. Want dvd support? Add that one in. Using a rhel5 kernel which requires special versions of packages such as udev? There's a mix-in for that too. Run a mail server? web server? There's mix-ins for those also. Expect this category to grow in the future as new mix-ins are created.
 
The contents of <code>/etc/portage/make.profile/parent</code> for a basic setup might look like this:
 
{{file|name=/etc/portage/make.profile/parent|body=
gentoo:funtoo/1.0/linux-gnu/arch/x86-64bit
gentoo:funtoo/1.0/linux-gnu/build/current
gentoo:funtoo/1.0/linux-gnu/flavor/core
}}
}}
After this, you'll have comments added to your blog!


A more rounded setup for a desktop might look like this:
==== Adding Google Analytics ====
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>}}.
{{file|name=default.hbs|lang=javascript|desc=adding Google Analytics|body=
<head>
...
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r] {{!}}{{!}}function(){
    (i[r].q=i[r].q {{!}}{{!}}[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');


{{file|name=/etc/portage/make.profile/parent|body=
    ga('create', 'UA-XXXXXXXX-X', 'yourblog.ghost.io');
gentoo:funtoo/1.0/linux-gnu/arch/x86-64bit
    ga('send', 'pageview');
gentoo:funtoo/1.0/linux-gnu/build/current
...
gentoo:funtoo/1.0/linux-gnu/flavor/desktop
</head>
gentoo:funtoo/1.0/linux-gnu/mix-ins/dvd
gentoo:funtoo/1.0/linux-gnu/mix-ins/media
}}
}}
This will activate Google Analytics for you to see your traffic!
=== Conclusion ===
The Ghost blogging platform is a great small, tool. This should be enough to get you well on your way to your new blog!


== Related ==
{{EbuildFooter}}
* [[Flavors and Mix-ins]]
 
[[Category:Funtoo features]]
[[Category:Portage]]
[[Category:Labs]]
[[Category:HOWTO]]
[[Category:Official Documentation]]

Revision as of 09:48, January 19, 2015

Ghost (Blogging Platform)

   Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.

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:

root # emerge ghost
root # 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:

   config.js (javascript source code) - ghost config
// # 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 config.js, you can start Ghost from:

root # 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:

   config.js (javascript source code) - ghost config
...
        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 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/.

   Note

This requires a basic knowledge of CSS

root # cp -r /usr/share/webapps/ghost/content/themes/casper/ /usr/share/webapps/ghost/content/themes/my-theme
root # nano -w /usr/share/webapps/ghost/content/themes/my-theme/assets/css/screen.css
   screen.css (css source code) - ghost theme
# Changing blockquotes:
blockquote {
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    padding-left:5px;
    padding-top:10px;
    padding-bottom:10px;
    border-left: #fff 3px solid;
    margin:25px;
    line-height:1.3em;
}

# Changing preformatted text for source code:
pre {
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    margin: 0 0 1.75em 0;
    border: #E3EDF3 1px solid;
    width: 100%;
    padding: 9.5px;
    font-family:'Source Code Pro', monospace;
    font-size: 13px;
    white-space: pre;
    overflow: auto;
    background: #000;
    border-radius: 6px;
    color:#ccc;
    word-break:break-all;
    word-wrap:break-word;
 }

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

You may also get some free themes from the Ghost Marketplace.

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>.

   post.hbs (javascript source code) - adding Disqus
</footer>
  <div id="disqus_thread"></div>
  <script type="text/javascript">
    var disqus_shortname = 'example'; // required: replace example with your forum shortname
    var disqus_identifier = '[[:Template:Post.id]]';

    /* * * DON'T EDIT BELOW THIS LINE * * */
    (function() {
      var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
      dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
      (document.getElementsByTagName('head')[0]  | | document.getElementsByTagName('body')[0]).appendChild(dsq);
    })();
  </script>
  <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
  <a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
</article>

After this, you'll have comments added to your blog!

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>.

   default.hbs (javascript source code) - adding Google Analytics
<head>
...
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r] ||function(){
    (i[r].q=i[r].q ||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-XXXXXXXX-X', 'yourblog.ghost.io');
    ga('send', 'pageview');
...
</head>

This will activate Google Analytics for you to see your traffic!

Conclusion

The Ghost blogging platform is a great small, tool. This should be enough to get you well on your way to your new blog!