# 全局安装 hexo-cli 脚手架 pnpm install hexo-cli -g # 如果是第一次使用会提示 ERR_PNPM_NO_GLOBAL_BIN_DIR Unable to find the global bin directory Run "pnpm setup" to create it automatically, or set the global-bin-dir setting, or the PNPM_HOME env variable. The global bin directory should be in the PATH. # 按照提示执行 pnpm setup 这个是要给自动设置一下全局的 全局 bin 目录 # 自动设置(也可执行其它命令指定,我用的自动的给默认到 /Users/ada/Library/pnpm 路径了 pnpm setup #To start using pnpm, run: source /Users/ada/.zshrc 执行完后会有提示,按照提示执行命令 source /Users/ada/.zshrc # 安装验证(安装成功了会输出对应的信息) hexo -v # 初始化创建一个博客 名字自己起(就是会创建一个文件并且给初始化好模板) hexo init hexo-ada-blog # 进入该文件夹 cd hexo-ada-blog # 安装依赖 pnpm install # 启动服务 也可以通过简写 hexo s 启动,启动默认本地 4000 端口,可通过链接进行访问 hexo server # 指定端口 hexo server -p 4001
更换主题
默认的主题比较丑,这里推荐更换为 butterfly 这个主题
1 2 3 4
title: 'GitHub - blinkfox/hexo-theme-matery: A beautiful hexo blog theme with material design and responsive design.一个基于材料设计和响应式设计而成的全面、美观的Hexo主题。国内访问:http://blinkfox.com' image: 'https://opengraph.githubassets.com/2b13c08198b30a3f53526a4931316200601e41b9751a5f004be924b2e7b3e78c/blinkfox/hexo-theme-matery' description: 'A beautiful hexo blog theme with material design and responsive design.一个基于材料设计和响应式设计而成的全面、美观的Hexo主题。国内访问:http://blinkfox.com - GitHub - blinkfox/hexo-theme-matery: A beautiful hexo blog theme with…' url: 'https://github.com/blinkfox/hexo-theme-matery'