Hexo学习(1) Mac中Hexo与GithubPages环境搭建
来源:互联网 发布:java输入scanner 编辑:程序博客网 时间:2024/06/06 09:43
0. 资料
- Github Pages官网
- Hexo官网
1. node.js安装
node.js官网中下载安装。
2. Git安装
git官网下载安装。
3. Hexo安装
# 在mac中有权限问题# 为了防止后面的问题,所有命令都使用sudo# 安装hexosudo npm install hexo-cli -gsudo npm install hexo-server --save
4. Hexo本地测试
# 初始化Hexo文件夹,需要下载点东西# minions这个名字可以随便取sudo hexo init minions# 进入文件夹cd minions# 不知道做什么sudo npm install# 生成静态页面sudo hexo g# 本地测试,本地测试网页为http://localhost:4000sudo hexo s
5. Hexo发布
5.1. github pages设置
引用Github Pages官网
Head over to GitHub and create a new repository named username.github.io, where username is your username (or organization name) on GitHub.
根据Github官网中的例子,Github中Repo名称必须是用户名.github.io
。向reposity中添加index.html之后,就可以通过http://username.github.io来访问网页了
5.2. hexo配置
# 在hexo目录中的_config.yml文件中进行配置# repo中可以使用https://username@github.com/username/username.github.io.git的形式,这样在每次提交时都需要输入密码deploy: type: git repo: git@github.com:irvingzhang0512/irvingzhang0512.github.io.git # repo: https://irvingzhang0512@github.com/irvingzhang0512/irvingzhang0512.github.io.git
5.3. hexo执行发布命令
# 安装插件sudo npm install hexo-deployer-git --save# 执行命令sudo hexo d# 每次部署的步骤sudo hexo cleansudo hexo generatesudo hexo deploy
6. 遇到的问题
6.1. 各种本地权限问题
解决方案:不管什么命令,都加上sudo
6.2. Permission denied
- 问题描述:在ssh -T git@github.com正常的情况下,
sudo hexo d
命令返回 - 解决:其实我也不知道是怎么解决的,我做了以下操作:
- git版本安装了旧版的1.9.5
- 在repo中使用了https的,在输入了密码后成功提交。之后将repo改成git地址后就好了……
0 0
- Hexo学习(1) Mac中Hexo与GithubPages环境搭建
- Hexo+GitHubPages搭建个人博客
- 了解githubPages+hexo搭建博客的原理
- hexo+gitHubPages 快速搭建个人博客
- Mac搭建hexo指南
- Mac搭建Hexo指南
- Mac搭建Hexo指南
- Hexo博客搭建(Mac)
- Hexo-mac下搭建hexo博客全过程
- GitHubPages+Hexo搭建免费个人博客(windows平台)
- 用Hexo-GithubPages-CodingPages搭建自己的个人博客
- Linux搭建hexo环境
- Hexo在Github中搭建博客系统(1)Hexo安装
- Hexo搭建与Markdown
- Mac通过HEXO搭建博客
- mac环境下搭建hexo+github pages+next个人博客
- Hexo系列1:从零开始搭建hexo博客
- 搭建hexo博客(1)
- Tomcat(一) Tomcat是什么:Tomcat与Java技术 Tomcat与Web应用 以及 Tomcat基本框架及相关配置
- Tomcat(二) Tomcat实现:Servlet与web.xml介绍 以及 源码分析Tomcat实现细节
- nagios插件之监控日志中index增长情况
- 反思与感悟
- 总结 mysql error 1130 hy000:Host'localhost'解决方案
- Hexo学习(1) Mac中Hexo与GithubPages环境搭建
- 自圆其说并发编程之——认识线程开销
- Android中的Handler机制分析(二) MessageQueue分析
- stm32f070 软件复位
- 文章标题
- [代码实例][SQLServer]关闭连接
- 【Android】为 RecyclerView增加监听以及数据混乱的小坑
- 失败加载jni分享库/Failed to load the jni shared library
- BZOJ 3527[Zjoi2014]力 FFT