基于Github Page 搭建博客(hexo框架)

git源码
Demo: www.kunlingou.club

搭建

初始博客环境

cnpm i -g hexo-cli
hexo init
cnpm install
复制代码

配置博客参数

./_config.yml

//部署(提交)模式
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: git
  repo: git@github.com:kunlingou/kunlingou.github.io.git
  branch: master

hexo s //启动服务
复制代码

部署(提交到git)

cnpm i -S hexo-deployer-git
hexo clean
hexo g -d //生成后部署hexo generate  hexo deploy 
复制代码

关联域名

./source/CNAME

www.kunlingou.club
复制代码
  • 部署服务

问题

  1. 无法访问googleapis相关链接jquery.min.js
    .\themes\landscape\layout\_partial\after-footer.ejs
    ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js替换为libs.baidu.com/jquery/2.0.3/jquery.min.js
hexo clean
hexo g -d
复制代码
  1. 主题(NexT)
    参考文档:官方文档
./

git clone https://github.com/theme-next/hexo-theme-next themes/next

./_config.yml

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
# theme: landscape
theme: next
复制代码
  • next
    git clone https://github.com/theme-next/hexo-theme-next themes/next

  • replica
    git clone git@github.com:sabrinaluo/hexo-theme-replica.git themes/replica

使用

hexo常用命令

hexo n "XXX"//新建文章
hexo g -d //生成静态文件,生成后部署
hexo s //启动本地服务器
hexo clean //清除缓存文件db.json和生成文件./public/
复制代码

option

hexo --safe //安全模式
hexo --debug //调试模式
hexo --silent //静默模式
复制代码
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值