个人博客地址http://lx.nextdev.top
这篇文章介绍了如何用coding page +hexo 无成本搭建个人博客。
需求环境:
必须环境:
开始
-
快速开始
打开
cmd
输入:
npm install -g hexo-cli
新建hexo项目:
hexo init <项目名称>
然后安装依赖:
npm install
完成!
-
修改网站配置
在
_config.yml
中可以修改配置。网站主配置:
title: 博客的名称 subtitle: 副标题 description: 博客的短描述 author: 作者 language: zh-Hans
域名配置:
url: 你的域名 root: 网站根目录,默认为/ permalink: 文章URL配置
主题配置:
theme: 在这里可以设置主题
推荐使用 next主题
git配置:
deploy: type: git repo: 项目库地址 branch: 分支
配置完成后输入:
npm install hexo-deployer-git --save
OK!博客配置完了
使用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: 支付宝扫码支付的图片地址