hexo+github+zeabur个人博客


title: blog
date: 2024-08-14 11:24:35
categories:

  • Hexo
  • blog
  • 教程

tags:

  • Hexo
  • 教程
    keywords: “blog,Hexo,github”
    cover: https://s2.loli.net/2024/08/14/xCVrUGEQ1WhSpPs.png

访问个人blog查看详情 https://caokaier.zeabur.app/

可以使用hexo+github pages直接搭建,这里使用zeabur设置域名访问

安装git、node.js(这里不过多赘述)

Hexo文档以及主题 https://hexo.io/zh-cn/ 注意官方文档很久没更新了

#验证Node.js、npm、git是否正常安装
node -v
npm -v
git -v
#安装Hexo
npm install -g hexo-cli   #国内安装较慢
#修改为使用阿里云镜像源安装
访问  https://npmmirror.com/  复制代码 即:
npm install -g cnpm --registry=https://registry.npmmirror.com   #这个过程可能相对较慢,耐心等待,安装后把npm换成cnpm使用
#安装Hexo
cnpm install -g hexo-cli
#初始化Hexo项目
hexo init blogfile     #在选定位置执行,会生成blogfile文件项目,拉取可能失败,多执行几次即可
#也可以新建好blogfile文件夹,进入后直接执行   hexo init          尝试几次发现这样拉取成功几率大
#我这里出现了一下错误,没有错误的可以忽略直接 hexo g   并启动服务 hexo s  这里 hexo init 时下载依赖失败    手动下载
#一下是全部过程,耐心查看
beast@gentle-beast MINGW64 /d
$ hexo init blogfile
INFO  Cloning hexo-starter https://github.com/hexojs/hexo-starter.git
INFO  Install dependencies
warning hexo > warehouse > cuid@2.1.8: Cuid and other k-sortable and non-cryptog
raphic ids (Ulid, ObjectId, KSUID, all UUIDs) are all insecure. Use @paralleldri
ve/cuid2 instead.
warning hexo-renderer-marked > jsdom > abab@2.0.6: Use your platform's native at
ob() and btoa() methods instead
warning hexo-renderer-marked > jsdom > data-urls > abab@2.0.6: Use your platform
's native atob() and btoa() methods instead
warning hexo-renderer-marked > jsdom > domexception@4.0.0: Use your platform's n
ative DOMException instead
warning hexo-renderer-stylus > stylus > glob@7.2.3: Glob versions prior to v9 ar
e no longer supported
warning hexo-renderer-stylus > stylus > glob > inflight@1.0.6: This module is no
t supported, and leaks memory. Do not use it. Check out lru-cache if you want a
good and tested way to coalesce async requests by a key value, which is much mor
e comprehensive and powerful.
WARN  Failed to install dependencies. Please run 'npm install' in "D:\blogfile"
folder.
#这里报错依赖
beast@gentle-beast MINGW64 /d
$ cd blogfile/

beast@gentle-beast MINGW64 /d/blogfile
$ ls
_config.landscape.yml  node_modules/  scaffolds/  themes/
_config.yml            package.json   source/
#使用cnpm手动安装
beast@gentle-beast MINGW64 /d/blogfile
$ cnpm install
√ Installed 10 packages on D:\blogfile
√ All packages installed (used 36ms(network 27ms), speed 0B/s, json 0(0B), tarba
ll 0B, manifests cache hit 0, etag hit 0 / miss 0)

#生成静态文件又报错,报错显示highlight.js 模块可能中出现了语法错误
beast@gentle-beast MINGW64 /d/blogfile
$ hexo g
INFO  Validating config
INFO  Start processing
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/d
ocs/troubleshooting.html
D:\blogfile\node_modules\highlight.js\lib\languages\isbl.js:1806
  // enum TE
SyntaxError: Unexpected end of input
    at wrapSafe (node:internal/modules/cjs/loader:1281:20)
    at Module._compile (node:internal/modules/cjs/loader:1321:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值