Giog (github issues blog) - 轻量级博客系统(built width vue ssr and koa)

2,298 阅读1分钟

Giog 是一个基于github issues 的轻量级博客系统,由 vue2.x + vue-router + vuex + axios 构建, 使用koa 进行服务端渲染。并使用了Github GraphQL API v4同步issues数据。

github: github.com/eteplus/gio…

功能

  • SSR(Server Side Rendering)
  • PWA(Progressive Web App)
  • 标签分类
  • 文章归档
  • 评论功能(仅支持预览,待完善)

后续功能会完善和优化

预览

  1. 预览地址:www.eteplus.com

  2. 手机预览二维码:

初始化

Required:

  • node >= 8.9.4
  • npm >= 5.6.0
# install dependencies
npm install # or yarn
  1. 修改配置文件 config/config.js.
userInfo: {
  // 个人 github 地址
  github: 'https://github.com/eteplus',
  // 用户名
  userName: 'ETEPLUS',
  // 头像地址
  avatar: '/static/img/avatar.jpeg',
  // 座右铭
  motto: 'Designer and Coder. ^_^',
},

siteInfo: {
  // 网站名称
  name: 'ETEPLUS',
  // 域名备案号 - ICP备xxxxx号
  recordText: ''
}
  1. 复制 config/github.example.json 至 config/github.json

Apply accessToken -> Page -> Personal access tokens -> Generate new token

pageSize: 每次同步issues的数量

{
  "accessToken": "github accessToken",
  "owner": "github username",
  "repository": "issues repository",
  "pageSize": 8
}
  1. 执行数据库迁移和同步issues数据
npm run db:migrate

npm run sync

清除数据库表:

所有数据会被清除,需要重新迁移和同步

npm run db:migrate:undo

构建


# serve in dev mode, with hot reload at 127.0.0.1:3030
npm run dev

# build for production
npm run build

# serve in production mode
npm start

部署

修改 pm2.json

pm2 startOrReload pm2.json