hexo+github

本次实践主要参考5分钟 搭建免费个人博客–dimsky

主要由以下步骤构成

1. GitHub

创建GitHub账户

在GitHub中创建仓库repository

2.安装

Git

Nodejs

​ 安装npm

Hexo

​ 利用npm安装hexo,在CMD或者GitBash中都可以

1
npm install hexo-cli -g

安装hexo-deployer-git自动部署发布工具

1
npm install hexo-deployer-git --save

3. 开始操作

初始化博客

使用   `cd` 到相应的路径,并执行以下命令
1
hexo init daydreamnist.github.io

主题安装

1 大专栏  hexo+github
2
cd username.github.io
git clone https://github.com/iissnan/hexo-theme-next themes/next

配置hexo

修改...daydreamnist.github.io\_config.yml键值

__#site
title: daydreamnist’s blog
subtitle: daydreamnist
description:
keywords:
author: YangYang
language: zh-Hans
timezone: Asia/Shanghai

_#Extensions
theme: next

_#Deployment
deploy:
type: git
repo: https://github.com/daydreamnist/daydreamnist.github.io.git
branch: master

配置博客首页

默认的博客首页,文章是全部显示,并且没有分类、标签

需要通过配置…daydreamnist.github.iothemesnext_config.yml键值

menu:
home: / || home
tags: /tags/ || tags
categories: /categories/ || th
archives: /archives/ || archive

auto_excerpt:
enable: true
length: 150

并且使用如下命令创建

1
hexo new page categories

4. 部署博客

1
2
3
hexo s #本地测试
hexo g #生成
hexo d #部署
1
2


原文地址:https://www.cnblogs.com/lijianming180/p/12041466.html