0元快速搭建属于自己的博客

作者: 凌霄_ | 来源:发表于2017-04-12 00:33 被阅读507次

个人博客地址http://lx.nextdev.top

这篇文章介绍了如何用coding page +hexo 无成本搭建个人博客。

next主题

需求环境:

必须环境:


开始

  • 快速开始

  • 打开 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主题

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: 支付宝扫码支付的图片地址

好了,你的博客到此为止,已经搭建完成。

相关文章

网友评论

  • 东邪Zzz:我本地浏览都可以看到,但是打开git地址就不行,说我的git没有pagers,应该怎么解决呢,求大神指导
    凌霄_: @g东邪 在输入hexo d的时候报的错吗
    东邪Zzz:@凌霄_ 报错显示 404 There isn't a GitHub Pages site here.
    If you're trying to publish one, read the full documentation to learn how to set up GitHub Pages for your repository, organization, or user account.
    凌霄_:有截图吗
  • pankx:同问
  • 莫寂岚:这个博客是部署在哪里的?git吗?

本文标题:0元快速搭建属于自己的博客

本文链接:https://www.haomeiwen.com/subject/efkpattx.html