hexo搭建blog及安装第三方主题Next等配置操作(一)

hexo搭建blog及安装第三方主题Next等配置操作(一)

快速开始:

1.安装Hexo

1
2
3
4
$ npm install hexo-cli -g

Install with brew on macOS and Linux:
$ brew install hexo

2.安装初始化博客

1
2
$ hexo init blog
$ cd blog

3.启动hexo服务:

1
$ hexo server -p 8080

4.创建一个新文章:

1
$ hexo new "Hello Hexo"

Front matter有哪些:

1
2
3
4
5
6
---
title: AI学画画001-ComfyUI入门篇
date: 2024-05-22 15:59:19
categories: 人工智能
tags: AI画画
---

5.生成静态文件

1
$ hexo generate

6.hexo服务重启脚本:

1
2
# cd /acdata/dba_tools/hexo_blog/blog
# cat restart_hexo.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

# ----------------------------------------------------------------
# Copyright © 2024 SUNACYW Ltd. All rights reserved.
# FileName : restart_hexo.sh
# Author : looismes
# Mail : [email protected]
# Version : v1.0.0
# CreateTime : 2024-05-24 11:49:10
# COPYRIGHT : Copyright ©2024 - 开源服务
# Description: Welcome Use The Script.
# ----------------------------------------------------------------


netstat -atnpu|grep 8080|grep LISTEN|awk '{print $NF}'|cut -d "/" -f1|while read line
do

kill -9 $line
echo "###########kill -9 $line############"
nohup hexo s -p 8080 &
sleep 5
netstat -atnpu|grep 8080|grep LISTEN

done