Skip to content

Instantly share code, notes, and snippets.

@btfak
Created May 26, 2016 09:41
Show Gist options
  • Save btfak/18938572f5df000ebe06fbd1872e4e39 to your computer and use it in GitHub Desktop.
Save btfak/18938572f5df000ebe06fbd1872e4e39 to your computer and use it in GitHub Desktop.
How to use Hexo and deploy to GitHub Pages

Quick Start

https://github.com/hexojs/hexo https://hexo.io/docs/

1. Install Hexo

$ npm install hexo-cli -g

$ hexo -v
hexo-cli: 0.1.9
os: Darwin 14.3.0 darwin x64
http_parser: 2.3
node: 0.12.7
v8: 3.28.71.19
uv: 1.6.1
zlib: 1.2.8
modules: 14
openssl: 1.0.1p

2. Create a directory for your new blog

$ hexo init yt8yt.github.io
INFO  Copying data to ~/source/yt8yt.github.io
INFO  You are almost done! Don't forget to run 'npm install' before you start blogging with Hexo!

$ cd yt8yt.github.io

$ npm install

3. Run a test server for your new blog on Mac

$ hexo server
INFO  Hexo is running at http://0.0.0.0:4000/. Press Ctrl+C to stop.

4. Set information of your new blog

https://hexo.io/docs/configuration.html

$ vi _config.yml
@aginanjar
Copy link

Awesome, thanks for sharing. (y)

@thirdgen88
Copy link

Agreed, covers all the aspects you need! Thanks!

@karthikkrishnadev
Copy link

Thank you so much! Works like a charm.

@CodeCanna
Copy link

Okay its not working for me...I must have missed something somewhere. I followed the directions but its not working. I commited and pushed the files to github the traditional way prior to finding these instructions, should I clean out the repo and try again?

@shengyu
Copy link

shengyu commented Jun 5, 2017

Thanks for sharing, it's really helpful.

@rankobp
Copy link

rankobp commented Jun 18, 2017

Thanks!

@gnehz972
Copy link

best hexo & github page tutorial

@agonzalez0515
Copy link

This is so good! First time using Hexo and this made it so easy.

@KINGSABRI
Copy link

KINGSABRI commented Aug 21, 2017

Install nodejs, nvm on ubuntu

Install required packages for nodejs

apt update
apt install build-essential libssl-dev
apt install nodejs
apt install npm

Install nvm

wget -qO- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash 

Install latest stable nodejs version

nvm install stable

update your profile - to find nvm path

source ~/.profile

Install hexo

npm install -g hexo-cli

Sources

@triyanarief
Copy link

thanks dude!

@wangjuanmt
Copy link

Thanks, it's very useful!

@HelloWhist
Copy link

thx

@BobHongYuChen
Copy link

thx

@ziyoushibo
Copy link

no ssh?

@fer
Copy link

fer commented Apr 10, 2018

Good stuff! Maybe worth to mention to add a CNAME under sources in order to use a custom domain.

@garyyu
Copy link

garyyu commented Apr 25, 2018

Nice and simple HowTo document~ Thanks!

@strongSoda
Copy link

vi _config.yml not working. Says vi is not an internal or external command

@ohkimchi
Copy link

Thank you so much, buddy!

@initialkommit
Copy link

Thank you. It's useful!

Copy link

ghost commented Aug 11, 2018

i changed my theme, my theme apply in local but i cannot reflect it to github page :((( even deploy many times

@Jonnypeng
Copy link

thank you.it's useful!

@yusupscopes
Copy link

Thank you! it's well explained!

@erlange
Copy link

erlange commented Jul 8, 2019

This is the most concise and useful hexo tutorial. Thanks!

@sirkaushalkumar
Copy link

This post is really helpful and awesome. Thank you for creating the piece.

@thanhdx0
Copy link

Thank you! Your post helps me a lot while I'm stuck with using Travis-CI.

@loyio
Copy link

loyio commented Apr 28, 2020

thanks,great tutorial

@devhector
Copy link

Thanks to share!! 🤙

@alifma
Copy link

alifma commented Jul 8, 2023

Still works on July 2023, thanks mate!

@ysy950803
Copy link

Nice!

@PurplePlanen
Copy link

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment