Hello,everyone. Do you want to have your own awesome blog, like as follows?

Moka Toy Theme

Moka Default Theme

My topic is The Easy Way to set up your own Blog today.

Maybe you would a questions, which is "I don't have a server, Where is my blog deployed? "
If you don't have the server, don't worry. you can sign up a github's name,then use github pages freely.

Straight to the point, your need to install nodejs>=6.0 and git after sign up a github's username.
And two choices, that is, command line and PC desktop.

Command Line

if your operation is Windows, open git bash terminal(in right-click menu), otherwise normal terminal.

input node -v and git --version

if their version display successily, congratulation!

OK! It's time that the leading role say hello to everyone.
The leading role is named Moka, supporting gym markdown syntax, generating your SPA (single page application) Blog.

Steps:
1. if you are in China, install cnpm (download Moka fast) by npm (node package manager, Be installed together with node) npm install -g cnpm --registry=https://registry.npm.taobao.org 2. install Moka by npm or cnpm npm install moka-cli -g # install moka on PATH

    # or
    cnpm install moka-cli -g
  1. check moka is installed moka -h # moka's usage

        # or
        moka --help
    
  2. create a empty directory as moka work directory cd /path/to/directory/ mkdir mokaBlog cd mokaBlog

  3. initiation in moka work directory moka init # -f option means empty this directory before init

        # or
        moka i
    
  4. list all files ls -R

  5. as you can see, directory static is empty after initiation, so you need generate static resource moka generate

    # or
    moka g
    
  6. list static directory

    yeah, the files in themes/moka/build/ are copied to static/, and generate a new directory named moka_api, ./moka.config.json and ./themes/moka/theme.config.json copied here. and generate a new file named db.json.

  7. run static local server for watch static/index.html moka staticServer # -p option means the port of static server

        # or
        moka ss
    
    open http://localhost:9888 # run in new terminal
  8. OK! if the above steps passed, congratulation. then you need set up your own Github Pages named {usename}.github.io, more info see User, Organization, and Project Pages
    and for deploying easily, you also need Generating a new SSH key and adding it to the ssh-agent and Adding a new SSH key to your GitHub account.

  9. update moka.config.json

    replace deploy.url to yourself, and if you want bakup your moka work directory, replace bak.url

  10. Deploy! moka d -g -b # -b option menus bakup, -g: generate Done! Open your blog (address: yourusername.github.io) and enjoy it.

  11. New Article moka new title

    # or
    moka n title
    

PC Desktop

you can get it on github release page, or contact me for latest one.
Moka is mixed in Moka Desktop, So you don't need to npm install -g moka-cli. It's awesome that Editor which has synchronic preview and easy way to insert image, and Directory Tree are mixed in Moka Desktop too.

Preview

alt

Why Use it

Some top blue buttons can be understood by Command Line above. Then you can watch right logs recording child process's output.
Server and Static Server will open a new window automatically after the server run successfully.

Editor can read the image from clipboard or drag datatransfer, so paste (ctrl/cmd+V) can insert the image fast.

a lot of editor's theme you can choose. alt

Some accelerator key on editor are as follows. mac's key is cmd, otherwise ctrl 1. ctrl/cmd + U
toggle about save article automatically 2. ctrl/cmd + B/M
font's size increase (B)/decrease (M) alt 3. ctrl/cmd + S
save 4. ctrl/cmd + F
find word in editor alt

Directory tree's operation alt

Source Code