Fork me on GitHub

Setting up my blog

Welcome to Andalucía Commerce! This is my very first post.

This blog is powered by Hexo. You can check this documentation for more info.
My Hexo theme is NexT.Gemini.

Set up the development environment

Config Git

1
2
$ git config --global user.name "Your GitHub Username"
$ git config --global user.email "Your GitHub E-mail"

Generate ssh keygen

1
$ ssh-keygen -t rsa -C "Your GitHub E-mail"

Copy id_rsa.pub
Open GitHub Settings keys, add a new SSH key.

Check your ssh key configuration.

1
$ ssh git@github.com

Check messages below on Git bash.

Hi your-user-name! You've successfully authenticated, but GitHub does not provide shell access.

Install Node.js

Download Node.js.

Download Node.js

You will setup npm automatically during Node.js installation.

Check Node.js & npm installation.

1
2
3
node -v

npm -v


Set up Hexo

Install

Create a new folder for whole blog project, open command window at that folder, type following command.

1
$ npm install -g hexo-cli

Init Hexo

1
$ hexo init [folder]

Initializes a website. If no folder is provided, Hexo will set up the website in the current directory.

Further test.

1
2
3
4
5
$ hexo new <new article title>

$ hexo generate

$ hexo server

More info about hexo new: Writing
More info about hexo generate: Generating
More info about hexo server: Server

Open this website: localhost, enjoy your first glance at your blog.

Deploy to remote sites

Open _config.yml in your blog folder, find & change

1
2
3
4
deploy: 
type: git
repo: https://github.com/your-github-name/username.github.io.git
branch: master

Intall Git Deployer

1
$ npm install hexo-deployer-git --save

Then,

1
2
3
$ hexo clean 
$ hexo g
$ hexo deploy

Note that g = generate.

Enter http://username.github.io and enjoy!

More info: Deployment


Change Theme

It’s easy to build a Hexo theme - you just have to create a new folder. To start using your theme, modify the theme setting in your site’s _config.yml. A theme should have the following structure:

1
2
3
4
5
6
.
├── _config.yml
├── languages
├── layout
├── scripts
└── source

You can easily find themes from Themes.

Download Theme

Take Theme.NexT for an example.

1
$ git clone https://github.com/iissnan/hexo-theme-next themes/next

Open _config.yml, find # Extensions, change theme: to next.
Then open the other _config.yml in /themes/next, find

1
2
3
4
5
6
7
8
# ---------------------------------------------------------------
# Scheme Settings
# ---------------------------------------------------------------
# Schemes
scheme: Muse
#scheme: Mist
#scheme: Pisces
#scheme: Gemini

Choose your favorite scheme and uncomment it.

Apply Changes

1
2
3
$ hexo clean 
$ hexo g
$ hexo s

Open this website to see changes applied: localhost

--- The following is a wasteland without any knowledge.---