long blogs

进一步有进一步惊喜


  • Home
  • Archive
  • Tags
  •  

© 2025 long

Theme Typography by Makito

Proudly published with Hexo

hexo 基本用法

Posted at 2019-03-11

常用的hexo命令

hexo new “newpostname” 新建文章

缩写:hexo n
hexo new page “newpagename”

hexo generate 生成静态界面至public目录

缩写: hexo g

hexo server 打开预览端口

缩写:hexo s

hexo deploy 部署到github中

缩写:hexo d

新建笔记配置

在指定目录生成对应tag的文章

1
hexo n --path=android/Android-JNI-日志输出 --tags android "xxx"

npm 使用淘宝映像

npm install --registry=https://registry.npm.taobao.org

本地hexo s无法访问

查询端口

netstat -o -n -a | findstr :4000
输出:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
C:\Users\mydesktop>netstat -o -n -a | findstr :4000
TCP 127.0.0.1:3391 127.0.0.1:4000 FIN_WAIT_2 11504
TCP 127.0.0.1:3392 127.0.0.1:4000 FIN_WAIT_2 11504
TCP 127.0.0.1:3393 127.0.0.1:4000 FIN_WAIT_2 11504
TCP 127.0.0.1:3395 127.0.0.1:4000 FIN_WAIT_2 11504
TCP 127.0.0.1:3397 127.0.0.1:4000 FIN_WAIT_2 11504
TCP 127.0.0.1:3482 127.0.0.1:4000 FIN_WAIT_2 9924
TCP 127.0.0.1:3483 127.0.0.1:4000 FIN_WAIT_2 9924
TCP 127.0.0.1:3549 127.0.0.1:4000 ESTABLISHED 9924
TCP 127.0.0.1:4000 0.0.0.0:0 LISTENING 4888
TCP 127.0.0.1:4000 127.0.0.1:3391 CLOSE_WAIT 4888
TCP 127.0.0.1:4000 127.0.0.1:3392 CLOSE_WAIT 4888
TCP 127.0.0.1:4000 127.0.0.1:3393 CLOSE_WAIT 4888
TCP 127.0.0.1:4000 127.0.0.1:3395 CLOSE_WAIT 4888
TCP 127.0.0.1:4000 127.0.0.1:3397 CLOSE_WAIT 4888
TCP 127.0.0.1:4000 127.0.0.1:3482 CLOSE_WAIT 4888
TCP 127.0.0.1:4000 127.0.0.1:3483 CLOSE_WAIT 4888
TCP 127.0.0.1:4000 127.0.0.1:3549 ESTABLISHED 4888
关闭占用端口进程

taskkill /F /PID 4888

如果无法关闭,使用其它端口启动

使用8080端口启动.hexo s -p 8080

Hexo添加mermaid

1.安装插件

`npm install hexo-filter-mermaid-diagrams

2.引入插件

1
2
3
4
5
6
# mermaid chart
mermaid: ## mermaid url https://github.com/knsv/mermaid
enable: true # default true
version: "7.1.2" # default v7.1.2
options: # find more api options from https://github.com/knsv/mermaid/blob/master/src/mermaidAPI.js
#startOnload: true // default true

3.引入js

在theme/themename/layout/_partial/after-footer.ejs中添加如下代码

1
2
3
4
5
6
7
8
{% if theme.mermaid.enable %}
<script src='https://unpkg.com/mermaid@{{ theme.mermaid.version }}/dist/mermaid.min.js'></script>
<script>
if (window.mermaid) {
mermaid.initialize({{ JSON.stringify(theme.mermaid.options) }});
}
</script>
{% endif %}

如果没有配置的话也可以直接使用写javascript。

Share 

 Previous post: 酷狗音乐排行爬虫 Next post: 辗转相除法 

© 2025 long

Theme Typography by Makito

Proudly published with Hexo