Create Your Blog Website with Hexo and Next Theme
Buy your blog website domain
You can buy a domain from the following domain registers:
Installing Hexo
Before installing Hexo, you need installing the following software
Installing Hexo
1 | npm install -g hexo-cli |
1 | hexo -v |
Uninstalling Hexo
1 | npm uninstall -g hexo-cli |
Create your Hexo project
1 | cd hexo-site |
Configuring Hexo
Configuring basic website information in _config.yml
Setting | Description |
---|---|
title |
The title of your website |
subtitle |
The subtitle of your website. (slogan) |
description |
The description of your website |
author |
Your name |
Run Hexo
1 | cd hexo-site |
Visit http://localhost:4000
NexT Theme
Installation NexT
If you’re using Hexo 5.0 or later, the simplest way to install is through npm.
1 | cd hexo-site |
Upgrading NexT
1 | cd hexo-site |
Enable NexT
Enable NexT in _config.yml
1 | theme: next |
Checking NexT
1 | hexo clean |
Visit http://localhost:4000
Settings
Copy default NexT configuration file to root path
1 | cp node_modules/hexo-theme-next/_config.yml _config.next.yml |
Enable cache in _config.next.yml
1 | cache: |
Enable minify in _config.next.yml
1 | minify: true |
Set Gemini Scheme in _config.next.yml
1 | #scheme: Muse |
Enable icons and badges in _config.next.yml
1 | menu_settings: |
Disable motion to load web pages faster in _config.next.yml
1 | motion: |
Update codeblock settings in _config.next.yml
. Choose your favorite code block theme on NexT Highlight Theme Preview.
1 | codeblock: |
Enable scroll percent in _config.next.yml
1 | back2top: |
Adding Page
Enable menu home, about, tags, categories, achives in _config.next.yml
1 | menu: |
Home and Archives pages exist by default.
We need to add tags, categories, and about pages
1 | hexo new page tags && hexo new page categories && hexo new page about |
Setting page type
- source/tags/index.md:
type: tags
- source/categories/index.md:
type: categories
- source/about/index.md:
type: about
For example:
1 | title: Tags |
Re-run your hexo project to see the new theme settings.
1 | hexo s --debug |
Add Search Service
Add the Local Search
Installation
1 | npm install hexo-generator-searchdb |
Configuring Hexo config file _config.yml
. Add the following configurations to the _config.yml
file
1 | search: |
Configuring NexT config file _config.next.yml
1 | local_search: |
Deploying your Hexo website
Push your Hexo project to GitHub
Create a new git repository on GitHub
Push your hexo project to GitHub
1 | git init . |
Deploying Hexo website to Vercel
Add new project on Vercel
Import Git Repository
Deploy the project
Domain settings for your project on Vercel
Add your domain in Vercel -> hexo project -> Settings -> Domains
Add vercel dns to your domain register
1 | ns1.vercel-dns.com |
Visit your domain in web browser