個人博客地址http://lx.nextdev.top
這篇文章介紹了如何用coding page +hexo 無成本搭建個人博客绵疲。
next主題
需求環(huán)境:
必須環(huán)境:
開始
-
快速開始
- 打開
cmd
輸入:
npm install -g hexo-cli
- 新建hexo項目:
hexo init <項目名稱>
- 然后安裝依賴:
npm install
- 完成!
-
修改網(wǎng)站配置
在 _config.yml
中可以修改配置竿拆。
- 網(wǎng)站主配置:
title: 博客的名稱
subtitle: 副標題
description: 博客的短描述
author: 作者
language: zh-Hans
- 域名配置:
url: 你的域名
root: 網(wǎng)站根目錄,默認為/
permalink: 文章URL配置
- 主題配置:
theme: 在這里可以設置主題
推薦使用 next主題
- git配置:
deploy:
type: git
repo: 項目庫地址
branch: 分支
- 配置完成后輸入:
npm install hexo-deployer-git --save
- OK!博客配置完了
-
使用Next主題
next主題
開始使用
用 cmd
打開 hexo
項目目錄婶芭,輸入:
git clone https://github.com/iissnan/hexo-theme-next themes/next
打開站點配置文件辛慰,修改以下代碼:
theme: next
運行
在 cmd
中輸入:
hexo g
然后再輸入:
hexo s
打開瀏覽器輸入:
http://localhost:4000/
成功!
部署到coding
在 cmd
中輸入:
hexo d
拓展
下文的主題配置文件為 \博客\themes\next\_config.yml
-
開啟炫酷背景:
- 打開主題配置文件并找到:
canvas_nest: false
- 改為:
canvas_nest: true
-
添加打賞功能
- 打開主題配置文件,修改以下內容
reward_comment: 打賞信息
wechatpay: 微信掃碼支付的圖片地址
alipay: 支付寶掃碼支付的圖片地址