Creating a GithubPage Blog with Hexo
Github Web: Create repo called username.github.io , where username is your username.
In my case: https://github.com/gabrieldelaparra/gabrieldelaparra.github.io
Github Web: Create another (private) repo called hexoBlog , where your hexo blog will be stored.
In my case: https://github.com/gabrieldelaparra/hexoBlog
1
$ npm install -g hexo-cli
1
2
3
$ hexo init hexoBlog
$ cd hexoBlog
$ npm install
Test Server
_config.yml:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
title: wororo
subtitle: wororo.
description: proyectos, ideas, tecnología, ocio
author: Gabriel De La Parra
language: en
timezone: America/Santiago
url: http://gabrieldelaparra.github.io
root: /
permalink: :year/:month/:day/:title/
permalink_defaults:
new_post_name: :year-:month-:day-:title.md
default_layout: post
titlecase: false
external_link: true
filename_case: 0
render_drafts: false
post_asset_folder: true
relative_link: false
future: true
highlight:
enable: true
line_number: true
auto_detect: false
tab_replace:
Connect to git 1
2
3
4
5
$ git init
$ git remote add origin https://github.com/gabrieldelaparra/hexoBlog.git
$ git add .
$ git commit -m "Empty Hexo Blog"
$ git push -u origin master
1
2
3
$ cd hexoBlog
$ npm install hexo-generator-json-content --save
$ git clone https://github.com/fi3ework/hexo-theme-archer.git themes/archer
_config.yml:
themes/archer/_config.yml:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
avatar: /avatar/me.jpg
author: gabrieldelaparra
signature: wororo
social:
email: ignacio.delaparra@gmail.com
github: //github.com/gabrieldelaparra
twitter: //twitter.com/gabeldelaostia
about:
enable: false
image: '/intro/about-page.jpg'
SEO_title: wororo
main_title: wororo.
subtitle: proyectos, ideas, tecnología, ocio
site_header_image: '/intro/back1.jpg'
post_header_image: '/intro/back1.jpg'
_404_image: '/intro/404.jpg'
show_dates:
Help! I’m not sure how to properly handle the following:
The archer theme is another git repo inside my hexoBlog repo (submodule, maybe, but). I want to be able to save my themes/archer/_config.yml to my repository. This for the case where I want to clone my own repository in another computer, or plain backup.
If I just do a git clone archer, and then delete the .git folder, then the files will be added to my repo, but then, I will not get any updates to the theme if the owner adds new features.
I think that I could do a fork and then merge changes manually in the future. I’m not sure how submodules work right now.
Any suggestions?
1
2
$ npm install hexo-deployer-git --save
$ vi _config.yml
_config.yml:
1
2
3
4
5
deploy:
type: git
repo: https://github.com/gabrieldelaparra/gabrieldelaparra.github.io
Adding new Posts and Deploying 1
2
3
4
$ hexo new postName
INFO Created: ~/blog/source/_posts/YYYY-MM-dd-postName.md
$ code source/_posts/YYYY-MM-dd-postName.md
1
2
$ hexo clean
$ hexo deploy -g