hexo + aliyun oss 每年9元搭建个人博客

2020-05-14  本文已影响0人  zs1621

title: 2020-02-03-hexo+aliyunOss搭建静态博客(MigrateFromOctopress)
date: 2020-02-03 07:09:10
tags: [hexo,aliyun,oss,静态博客,typora]


需要准备的

hexo init

blog 文件目录

image-20200202182137184.png
# install themes(在hexo根目录)
git clone https://github.com/yelog/hexo-theme-3-hexo themes/3-hexo
# 修改_config.yml
theme: 3-hexo

hexo 常用操作(source)

hexo deploy

deploy:
# 将 blog 发布到 github gh-pages
- type: git
  repo: git@github.com:zs1621/dadoudou.me.git
# 将blog 发布到 aliyun oss 
- type: aliyun
  bucket: xxxxx
  region: oss-us-west-1
  accessKeyId: xxxx
  accessKeySecret: xxxx
  timeout: 180s

注意:

  1. 在阿里云oss控制台里->bucket -> 域名绑定 (设置cname )
  2. 设置静态网页 bucket -> 基础设置 -> 静态页面 默认首页 index.html (https://help.aliyun.com/document_detail/31872.html?spm=5176.8466029.static.1.3dd71450txechL)
  3. 如果 使用zs1621/hexo-deployer-aliyun 这个插件自动部署 就不需要手动设置 了 忽略上面的2

文章写完了 执行生成 html(hexo generate) , 然后部署

INFO  Deploying: aliyun
INFO  Uploading files to Aliyun...
.
.
.
INFO  Deploy done: aliyun
上一篇下一篇

猜你喜欢

热点阅读