安装hexo
hexo官网https://hexo.io/
npm install -g hexo-cli
![img_e99b616ed014b25d65d8c74f38a08182.jpe](https://i-blog.csdnimg.cn/blog_migrate/6c5d36fb7fae2f3397f38c0192a784ae.jpeg)
安装hexo
初始化目录
hexo init <可以写你要初始化的目录 不写则是当前目录>
![img_102e1549bb410b544c9063760dfd2db3.jpe](https://i-blog.csdnimg.cn/blog_migrate/49b67249a484a7eb7c0dacf45f8340c8.jpeg)
初始化目录
初始化完成在目录下执行:
npm install
启动服务
hexo server
![img_e348f1f5156d89a0bed084d05abb99bc.jpe](https://i-blog.csdnimg.cn/blog_migrate/4090b35537f6dd0f7bf5664b9efd3994.jpeg)
启动
![img_98c77b9c398447b7dad703596dd10104.jpe](https://i-blog.csdnimg.cn/blog_migrate/89e87d9d642ec618955ce069783c7b45.jpeg)
访问页面
安装next主题
next主题(http://theme-next.iissnan.com/)
git clone https://github.com/iissnan/hexo-theme-next themes/next
修改配置:
nano _config.yml
![img_294366a105f3696cb6dc843d4f1b8d0d.jpe](https://i-blog.csdnimg.cn/blog_migrate/6c21c207a83e4c33c994d8326703ddc2.jpeg)
打开修改文件
或是(随你):
vi _config.yml
![img_1507b77ff69e8d9b00c87c4058b2e1a8.jpe](https://i-blog.csdnimg.cn/blog_migrate/0cac404bdb3c010bf142820facdf2679.jpeg)
安装next主题
![img_7e0cf1e3b4b5fff3c5f67e6b95759e5a.jpe](https://i-blog.csdnimg.cn/blog_migrate/42e1c5d915ee49fceeb02bfd600395bc.jpeg)
默认效果
安装后台管理
安装hexo-admin((https://github.com/jaredly/hexo-admin)[https://github.com/jaredly/hexo-admin])
npm install --save hexo-admin
![img_a904ff6bcd61a7dd80a8f6d6e526097a.jpe](https://i-blog.csdnimg.cn/blog_migrate/be202df3e3de1e576281ca299e3cee0f.jpeg)
hexo-admin
配置后台管理
访问http://你的Orange Pi Zero IP:4000/admin
![img_fef4fc64e82690d8a127fb6ba2635403.jpe](https://i-blog.csdnimg.cn/blog_migrate/9193a19f4369d9abd84399871b799826.jpeg)
demo
进入设置页面点击超链接
![img_b2e84e6b4995ea29077e4a5fea24af86.jpe](https://i-blog.csdnimg.cn/blog_migrate/a3582231ecdeb7330a7cbc613b1afe40.jpeg)
demo
配置用户名、密码和cookie秘钥,复制图示红色框框内的内容
![img_c43fc71828987ca17dbfcef6d98dce3d.jpe](https://i-blog.csdnimg.cn/blog_migrate/5cd472000257d2871f6b7271b30aef41.jpeg)
demo
编辑_config.yml在最后粘贴内容
![img_edd4392bead18b4b227d7f2a53b2bb1e.jpe](https://i-blog.csdnimg.cn/blog_migrate/69362b2007b9279e5f6d26bd5f788ab4.jpeg)
比如
再次访问后台
![img_89b5838ab13a6ccaccea66657e7d3886.jpe](https://i-blog.csdnimg.cn/blog_migrate/014b61c868a8bbc0cf2b1b0a1295380f.jpeg)
再次访问
_config.yml配置文件中文说明:
# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/
# Site
title: Hexo-demo #网站标题
subtitle: hexo is simple and easy to study #网站副标题
description: this is hexo-demo #网栈描述
author: pomy #你的名字
language: zh-CN #网站使用的语言
timezone: Asia/Shanghai #网站时区
# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: http://yoursite.com
root: /
permalink: :year/:month/:day/:title/
permalink_defaults:
# Directory 目录配置
source_dir: source #资源文件夹,这个文件夹用来存放内容
public_dir: public #公共文件夹,这个文件夹用于存放生成的站点文件
tag_dir: tags #标签文件夹
archive_dir: archives #归档文件夹
category_dir: categories #分类文件夹
code_dir: downloads/code #Include code 文件夹
i18n_dir: :lang #国际化文件夹
skip_render: #跳过指定文件的渲染,您可使用 glob 来配置路径
# Writing 写作配置
new_post_name: :title.md # 新文章的文件名称
default_layout: post #默认布局
titlecase: false # Transform title into titlecase
external_link: true # Open external links in new tab
filename_case: 0 #把文件名称转换为 (1) 小写或 (2) 大写
render_drafts: false #显示草稿
post_asset_folder: false #是否启动资源文件夹
relative_link: false #把链接改为与根目录的相对位址
future: true
highlight: #代码块的设置
enable: true
line_number: true
auto_detect: false
tab_replace:
# Category & Tag 分类 & 标签
default_category: uncategorized #默认分类
category_map: #分类别名
tag_map: #标签别名
# Date / Time format 时间和日期
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss
# Pagination 分页
## Set per_page to 0 to disable pagination
per_page: 10 #每页显示的文章量 (0 = 关闭分页功能)
pagination_dir: page #分页目录
# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
# theme: jane
theme: next#主题
# Markdown语法
## https://github.com/chjj/marked
markdown:
gfm: true
pedantic: false
sanitize: false
tables: true
breaks: true
smartLists: true
smartypants: true
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type:
# hexo-admin authentification
admin: #管理员
username: 用户名
password_hash: hash密码
secret: 这里我是瞎写的你们看情况喽
结束
大概就写这么多,当然关于hexo不仅仅就这么点东西,大家可以多去官网看看文档和其他一些好看的主题与插件 (^-^)V