Build a personal blog with Hexo + Github
First, preparation
- Install the nodeNodejs.org/en/download…
- Install git git-scm.com/downloads
- Install hexo NPM install hexo-cli -g
- Create a github account and create a project (the account name at ⚠️ is your project name, for example: my account is cc and the project name is cc.github.io.git)
Two, Hexo is going to perform
- Build the project
$hexo init < project name > $cd< project name >$NPM installCopy the code
-
Start the project
$ hexo sCopy the code
-
Modify configuration _config.yml
// Change the title# SiteTitle: Wang Xinyue's blog subtitle: Front-end process // modify the upload address# Deployment ## Docs: https://hexo.io/docs/deployment.html deploy: type: git repo: https://github.com/cc/cc.github.io.git branch: master Copy the code
-
Modify source/_posts/hello-world.md and you get the following page
3. Hexo has reached the battlefield
- Install a hot update
$ npm install hexo-browsersync --saveCopy the code
- Install Git support and upload
$ npm install hexo-deployer-git --saveCopy the code
- Hexo should reach the battlefield
$hexo g // Package $hexo d // upload to GithubCopy the code
- Enter url to view
https://cc.github.io.git (cc is your github username)
Four, get a skin sou
The yilia theme is recommended here
- Download the command
$ cd ./themes/ $ git clone https://github.com/JoeyBling/hexo-theme-yilia-plus.git ./yilia-plusCopy the code
-
Modifying a Configuration File
# Extensions ## Plugins: https://hexo.io/plugins/ ## Themes: https://hexo.io/themes/ theme: yilia-plusCopy the code
-
Rebuild and restart
$hexo g // Pack $hexo S // restart $hexo clean // Re-hexo g $hexo d // upload to Github if not in effectCopy the code
If you want other themes you can download them at hexo. IO /themes/
Wang Xinyue’s blog
Chatter about configuration changes