Hexo-hexo+github创建个人博客

2018-06-24  本文已影响0人  playman

本文通过Hexo+github以及腾讯云搭建一个个人博客

1、GitHub账户

2、腾讯云账号以及域名

3、Node.js环境

4、Windows 下 Git环境

本文操作环境为 Win7 64bit

GitHub账号

1、官网注册——https://github.com/
注册页面
2、创建仓库
创建仓库
命名

选择一个主题


选择设置
选择主题

之后保存【save】就可以了
然后访问 你的github用户名.github.io 就可以看到

腾讯云账号以及域名

1、注册腾讯云——https://dnspod.qcloud.com/?from=qcloud/
2、购买域名
域名购买

按照流程一步一步走下来即可

安装Node.js环境

1、官网下载——https://nodejs.org/en/
Node.js官网
2、安装

双击安装,一路【next】


Node.js安装

安装Git环境

1、官网下载Git——https://git-scm.com/
Git官网
2、安装

一样,一路【next】


Git安装

恭喜,没有出错就准备工作做好了~~~


正文

安装Hexo

1、创建一个文件夹(英文命名)

创建空的文件夹

2、启动 GitBsah

启动命令框
命令框

3、安装Hexo

$ npm install -g cnpm --registry=https://registry.npm.taobao.org
$ cnpm install -g hexo-cli
$ cnpm install hexo --save

验证一下

$ hexo -v
Hexo版本
$ hexo init
$ cnpm install
$ hexo s -g

打开浏览器 http://localhost:4000/

默认页面
【Ctrl】+【c】 停止运行
#博客名称
title: 我的博客
#副标题
subtitle: 一天进步一点
#简介
description: 记录生活点滴
#博客作者
author: ben boss
#博客语言
language: zh-CN
#时区
timezone:
#博客地址,与申请的GitHub一致
url: http://username.github.io
root: /
#博客链接格式
permalink: :year/:month/:day/:title/
permalink_defaults:
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link: true # Open external links in new tab
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
enable: true
line_number: true
auto_detect: true
tab_replace:
default_category: uncategorized
category_map:
tag_map:
#日期格式
date_format: YYYY-MM-DD
time_format: HH:mm:ss
#分页,每页文章数量
per_page: 10
pagination_dir: page
#博客主题,选择其它主题,在这里是要将themes中的文件夹名替换这里的
theme: landscape
#发布设置
deploy:
type: git
#elfwalk改为你的github用户名
repository: https://github.com/username/username.github.io.git

到这里,本地搭建完成


安装主题

主题的介绍页面

https://github.com/hexojs/hexo/wiki/Themes

以hexo-theme-yilia举例——https://github.com/litten/hexo-theme-yilia

看下一篇博客吧~~

Hexo-theme-yilia 简单配置

上一篇 下一篇

猜你喜欢

热点阅读