HexoConfigure
基本配置
select theme
Best Hexo Themes (Hand-picked) | Statichunt
安装出问题 更换镜像源
https://www.lemonneko.cn/win10%E6%90%AD%E5%BB%BAhexo%E5%8F%8A%E9%81%87%E5%88%B0%E7%9A%84%E5%9D%91/
上传到分支
// git初始化
git init
// 添加仓库地址
git remote add origin https://github.com/用户名/仓库名.git
// 新建分支并切换到新建的分支
git checkout -b 分支名
// 添加所有本地文件到git
git add .
// git提交
git commit -m ""
// 文件推送到hexo分支
git push origin hexo
其他设备安装好环境(支持跨平台),先clone hexo分支到本地
git clone -b hexo git@github.com:noteforme/noteforme.github.io.git
// 安装hexo , 下不下来就用privoxy
npm install hexo
// 注意这里不需要hexo初始化:hexo init;否则之前的hexo配置参数会重置
// 安装依赖库
npm install
// 安装部署相关配置
npm install hexo-deployer-git
//如果出错执行下面的
npm install -g hexo-cli
这要就完成同步了(上面的流程还不是很规范,不过执行上面几个命令基本都能解决)
如果有这些不用管了
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {“os”:”darwin”,”arch”:”any”} (current: {“os”:”win32”,”arch”:”x64”
问题:在ubuntu上,执行hexo d部署后每次都要输入github用户名和密码,在这里也找到了答案,就是根目录下的 _config.yml文件没有配置成ssh,之前是这样的 repository:https://github.com/noteforme/noteforme.github.io.git
Deployment
Docs: https://hexo.io/docs/deployment.html
deploy:
type: git
repository: git@github.com:noteforme/noteforme.github.io.git
branch: master
参考:http://www.jianshu.com/p/6fb0b287f950
https认证:Cloudflare免费的ssl
创建账户
注册 https://www.cloudflare.com/a/sign-up
登录后输入域名,点击扫描
如图
一直continue,到了Selet a Cloudflare Plan 选择Free Website
解析域名的地方,修改域名服务器,我这里是在godaddy修改,然后continue
点击Preview on your site instantly-> 点击Overview(显示Active即可)->点击Crypto(选择Flexible)
参考:http://www.jianshu.com/p/92b6d4a6ecd5
mac install hero
1 |
|
theme didn’t commit to GitHub ,so you could clone theme
hexo next theme
修改主题
git clone git@github.com:ppoffice/hexo-theme-icarus.git themes/icarus
里面都有介绍,主要石npm安装不了插件
就需要这篇文章 的polipo工具,最有名的Privoxy反而不起作用
分类
只要在 博客头部加 categories: “BLOG” 就会自动展示分类了,如果觉得每次添加麻烦的话,修改scaffolds/post.md 模板
title: HexoConfigure
date: 1501567432000
tags:
categories:
comments: true
然后hexo n “yourblog”,就会有这些了,接下里就是在首页分类进行关联了
生成 分类(默认已有分类)
1 |
|
- 新建page: $ hexo new page “categories” ,在 hexo > source 文件夹中会出现一个categories文件夹
- 打开categories文件夹中的index.md页面,在头部添加 – type: “categories” (为了点击的时候链接生效)
- 在hexo > theme > next > _config.yml 中修改menu下的categorues,去掉前面井号注释。 然后就可以看到分类页面了
next 添加头像
新建uploads文件夹,放入图片
找到themes/next 下的 -config.yml,修改如下图所示
1 |
|
Mac Hexo安装
command not found: hexo的解决方法
$ npm root -g
获取node_modules地址
/Users/guo/.npm-global/lib/node_modules
1 |
|
也可以去修改/.zshrc 或者/.bashrc,在里面添加上述命令,然后 source ~/.zshrc
图片不显示
这个图片怎么弄也没用,最终把资源包从旧的电脑,复制到新电脑解决了
打开/node_modules/hexo-asset-image/index.js,将内容更换为下面的代码
1 |
|
https://moeci.com/posts/hexo-typora/
https://juejin.cn/post/7006594302604214280
https://www.bilibili.com/video/BV1D7411U7Yk/
卸载插件
1 |
|
安装插件
1 |
|
_config.yml
1 |
|
hexo node 升级
1 |
|
https://blog.csdn.net/lvqinglou/article/details/115858349
npm-check
检查升级
https://ephen.me/2022/blog-updates-plus/
wordpress on mac
How to Install WordPress Locally (Windows, Mac, Linux)
database name : mysql