windows下hexo搭建博客


title:
summary: 简单介绍windows下hexo的安装,以及相关命令的使用。
author: foochane
top: false
cover: false
mathjax: false
categories: hexo
tags:

  • hexo
  • 博客
    date: 2019-05-22 09:25
    urlname: 2019052201

1 安装node.js

下载node.js的网址https://nodejs.org/en/download/
点击安装

在命令提示符中使用 node -v 命令来测试 node.js 是否安装成功。

2 安装hexo

npm install -g hexo-cli

3 搭建博客

hexo init hexo # 初始化
hexo install  # 安装依赖
hexo g # 生产静态文件
hexo s # 启动服务器

4 查看博客

浏览器访问http://127.0.0.1:4000

5 修改主题

Hexo 根目录下的 _config.yml 的 theme 的值:theme: hexo-theme-matery

6 新建分类 categories 页

categories 页是用来展示所有分类的页面,如果在你的博客 source 目录下还没有 categories/index.md 文件,那么你就需要新建一个,命令如下:

hexo new page "categories"

编辑你刚刚新建的页面文件 /source/categories/index.md,至少需要以下内容:

---
title: categories
date: 2019-05-24 09:10:30
type: "categories"
layout: "categories"
---

7 新建标签 tags 页

输入如下命令:

hexo new page "tags"
---
title: tags
date: 2019-05-24 09:16:04
type: "tags"
layout: "tags"
---

8 新建关于我 about 页

about 页是用来展示关于我和我的博客信息的页面,如果在你的博客 source 目录下还没有 about/index.md 文件,那么你就需要新建一个,命令如下:

hexo new page "about"

编辑你刚刚新建的页面文件 /source/about/index.md,至少需要以下内容:

---
title: about
date: 2019-05-24 09:16:04
type: "about"
layout: "about"
---

9 部署博客

hexo d

本文作者:foochane
本文链接:https://foochane.cn/article/2019052201.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值