本文用于记录xin如何使用GitHub上建立个人博客。我的博客。使用安知鱼大佬的主题博主是前端小白,所以本教程只介绍如何搭建个人博客。
本文建议将博客在本地完全配置好后再将博客同步到Github上,如果未在本地配置好,每次更新配置后将文件同步到Github上后因为浏览器缓存等原因将会导致博客不能及时显示更改后的配置是否生效
准备工作安装nodejsHexo是基于nodeJS编写的,所以需要安装一下nodeJs和里面的npm工具。windows:官方安装,选择LTS版本即可。Linux:
12sudo apt-get install nodejssudo apt-get install npm
安装完成后,打开命令行,输入以下两行检查NodeJs是否安装成功
12node -vnpm -v
安装hexo进入想要安装hexo的目录,使用命令
1npm install -g hexo-cli
使用命令hexo -v查看hexo版本
搭建博客为了提高效率,以及为了安装界面的简便性,使用vscode的命令行进行开发。在VScode中打开命令行,进入你想存放博客的目录比如D盘,初始化博客根目录
...
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick StartCreate a new post1$ hexo new "My New Post"
More info: Writing
Run server1$ hexo server
More info: Server
Generate static files1$ hexo generate
More info: Generating
Deploy to remote sites1$ hexo deploy
More info: Deployment














