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
npm install -g hexo-cli |
hexo -v |
Uninstalling Hexo
npm uninstall -g hexo-cli |
Create your Hexo project
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
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.
cd hexo-site |
Upgrading NexT
cd hexo-site |
Enable NexT
Enable NexT in _config.yml
theme: next |
Checking NexT
hexo clean |
Visit http://localhost:4000
Settings
Copy default NexT configuration file to root path
cp node_modules/hexo-theme-next/_config.yml _config.next.yml |
Enable cache in _config.next.yml
cache: |
Enable minify in _config.next.yml
minify: true |
Set Gemini Scheme in _config.next.yml
#scheme: Muse |
Enable icons and badges in _config.next.yml
menu_settings: |
Disable motion to load web pages faster in _config.next.yml
motion: |
Update codeblock settings in _config.next.yml
. Choose your favorite code block theme on NexT Highlight Theme Preview. Recommend highlight themes: stackoverflow-light
, intellij-light
.
codeblock: |
Disable line number in _config.yml
(Optional)
highlight: |
Enable scroll percent in _config.next.yml
back2top: |
Update favicon in _config.next.yml
favicon: |
Adding Page
Enable menu home, about, tags, categories, achives in _config.next.yml
menu: |
Home and Archives pages exist by default.
We need to add tags, categories, and about pages
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:
title: Tags |
Re-run your hexo project to see the new theme settings.
hexo s --debug |
Add Search Service
Add the Local Search
Installation
npm install hexo-generator-searchdb |
Configuring Hexo config file _config.yml
. Add the following configurations to the _config.yml
file
search: |
Configuring NexT config file _config.next.yml
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
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
ns1.vercel-dns.com |
Visit your domain in web browser