使用Orange Pi Zero做小小服务器(hexo博客篇)

简介: 安装hexohexo官网https://hexo.io/npm install -g hexo-cli安装hexo初始化目录hexo init 初始化目录初始化完成在目录下执行:npm install...

安装hexo

hexo官网https://hexo.io/

npm install -g hexo-cli
img_e99b616ed014b25d65d8c74f38a08182.jpe
安装hexo

初始化目录

hexo init  <可以写你要初始化的目录 不写则是当前目录>
img_102e1549bb410b544c9063760dfd2db3.jpe
初始化目录

初始化完成在目录下执行:

npm install

启动服务

hexo server
img_e348f1f5156d89a0bed084d05abb99bc.jpe
启动
img_98c77b9c398447b7dad703596dd10104.jpe
访问页面

安装next主题

next主题(http://theme-next.iissnan.com/)

git clone https://github.com/iissnan/hexo-theme-next themes/next

修改配置:

nano _config.yml
img_294366a105f3696cb6dc843d4f1b8d0d.jpe
打开修改文件

或是(随你):

vi _config.yml
img_1507b77ff69e8d9b00c87c4058b2e1a8.jpe
安装next主题
img_7e0cf1e3b4b5fff3c5f67e6b95759e5a.jpe
默认效果

安装后台管理

安装hexo-admin((https://github.com/jaredly/hexo-admin)[https://github.com/jaredly/hexo-admin])

npm install --save hexo-admin
img_a904ff6bcd61a7dd80a8f6d6e526097a.jpe
hexo-admin

配置后台管理

访问http://你的Orange Pi Zero IP:4000/admin

img_fef4fc64e82690d8a127fb6ba2635403.jpe
demo

进入设置页面点击超链接


img_b2e84e6b4995ea29077e4a5fea24af86.jpe
demo

配置用户名、密码和cookie秘钥,复制图示红色框框内的内容


img_c43fc71828987ca17dbfcef6d98dce3d.jpe
demo

编辑_config.yml在最后粘贴内容

img_edd4392bead18b4b227d7f2a53b2bb1e.jpe
比如

再次访问后台

img_89b5838ab13a6ccaccea66657e7d3886.jpe
再次访问

_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

相关文章
|
29天前
|
Ubuntu JavaScript 关系型数据库
在阿里云Ubuntu 20.04服务器中搭建一个 Ghost 博客
在阿里云Ubuntu 20.04服务器上部署Ghost博客的步骤包括创建新用户、安装Nginx、MySQL和Node.js 18.x。首先,通过`adduser`命令创建非root用户,然后安装Nginx和MySQL。接着,设置Node.js环境,下载Nodesource GPG密钥并安装Node.js 18.x。之后,使用`npm`安装Ghost-CLI,创建Ghost安装目录并进行安装。配置过程中需提供博客URL、数据库连接信息等。最后,测试访问前台首页和后台管理页面。确保DNS设置正确,并根据提示完成Ghost博客的配置。
在阿里云Ubuntu 20.04服务器中搭建一个 Ghost 博客
|
6月前
|
弹性计算 关系型数据库 Apache
基于ECS搭建云上博客
本场景将基于一台配置了CentOS 7.7操作系统的ECS实例(云服务器)。通过本教程的操作,您可以在一台CentOS 7.7操作系统的ECS实例上安装和部署LAMP环境,然后安装 WordPress,帮助您快速搭建自己的博客。
基于ECS搭建云上博客
|
3月前
|
弹性计算 关系型数据库 MySQL
带你读《弹性计算技术指导及场景应用》——2. 免费试用ECS,轻松搭建WordPress博客平台使用
带你读《弹性计算技术指导及场景应用》——2. 免费试用ECS,轻松搭建WordPress博客平台使用
182 0
|
4月前
|
弹性计算 监控 关系型数据库
阿里云ECS e实例最佳实践测评:搭建云上博客
阿里云ECS e实例最佳实践测评:搭建云上博客
56089 2
|
5月前
|
安全 JavaScript 前端开发
如何下载博客模板部署在自己的服务器上
如何下载博客模板部署在自己的服务器上
33 0
|
7月前
|
弹性计算 关系型数据库 Apache
基于ECS搭建云上博客
本场景教你如何在 ECS云服务器(CentOS7)的环境下,通过部署 LAMP环境并安装 WordPress 快速搭建个人博客。
244 0
|
8月前
|
弹性计算 关系型数据库 Serverless
基于ECS和云数据库RDS MySQL Serverless搭建超可爱的二次元博客搭建心得
使用Ubuntu系统,通过使用Apache2、PHP以及云数据库RDS MySQL Serverless搭建Wordpress博客,并对其进行二次元美化,完成之后分享一下参加此活动的感受。
|
8月前
|
弹性计算 Ubuntu JavaScript
【ECS生长万物之开源】搭建Ghost博客(Ubuntu)
Ghost是一个基于Node.js开发的免费开源博客平台,用于简化博客的写作发布等流程。本文介绍如何在Ubuntu 20.04操作系统的ECS实例上部署Ghost博客。
|
8月前
|
jenkins Java Linux
【Linux】云服务器自动化部署VuePress博客(Jenkins)
【Linux】云服务器自动化部署VuePress博客(Jenkins)
206 0
【Linux】云服务器自动化部署VuePress博客(Jenkins)
|
9月前
|
弹性计算 缓存 安全
基于ECS搭建云上博客
随着互联网的迅猛发展,个人博客已经成为许多人记录生活、分享知识和表达观点的重要平台。而基于ECS(弹性计算服务)搭建云上博客,不仅能够提供稳定可靠的服务器环境,还能够实现简洁高效的写作空间。本文将介绍如何使用ECS搭建云上博客,并分享一些优化建议。
310 0