Skip to content

Commit

Permalink
🔖 发布 v1.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Jan 16, 2020
1 parent 1dadfe7 commit 34137c3
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 6 deletions.
11 changes: 11 additions & 0 deletions changelogs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## v1.9.1 / 2020-01-16

### 引入特性

* [编辑器 Vditor 所见即所得](https://github.com/88250/pipe/issues/8)

### 改进功能

* [使用社区登录](https://github.com/88250/pipe/issues/6)
* [加入返回博客信息接口](https://github.com/88250/pipe/issues/7)
* [关闭评论功能后不显示评论相关模块](https://github.com/88250/pipe/issues/10)
File renamed without changes.
2 changes: 1 addition & 1 deletion console/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion console/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pipe-admin",
"version": "1.9.0",
"version": "1.9.1",
"author": "Vanessa <[email protected]>",
"private": true,
"config": {
Expand Down
14 changes: 14 additions & 0 deletions controller/indexctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package controller

import (
"github.com/88250/pipe/util"
"io/ioutil"
"net/http"
"path/filepath"
Expand All @@ -41,6 +42,19 @@ func showIndexAction(c *gin.Context) {
t.Execute(c.Writer, nil)
}

func showChangelogsAction(c *gin.Context) {
data, err := ioutil.ReadFile("changelogs.md")
if nil != err {
logger.Errorf("load changelogs.md failed: " + err.Error())
c.String(http.StatusNotFound, "load changelogs failed")

return
}

result := util.Markdown(string(data))
c.Data(http.StatusOK, "text/html; charset=utf-8", gulu.Str.ToBytes(result.ContentHTML))
}

func showStartPageAction(c *gin.Context) {
t, err := template.ParseFiles("console/dist/start/index.html")
if nil != err {
Expand Down
2 changes: 1 addition & 1 deletion controller/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ func MapRoutes() *gin.Engine {
indexGroup := ret.Group("")
indexGroup.Use(fillUser)
indexGroup.GET("", showIndexAction)
indexGroup.GET(util.PathChangelogs, showChangelogsAction)

initGroup := ret.Group(util.PathInit)
initGroup.Use(fillUser)
initGroup.GET("", showStartPageAction)

ret.Static(util.PathConsoleDist, "console/dist")
ret.StaticFile(util.PathChangelogs, "changelogs.html")
ret.StaticFile(util.PathRobots, "theme/robots.txt")
ret.NoRoute(func(c *gin.Context) {
notFound(c)
Expand Down
2 changes: 1 addition & 1 deletion model/confs.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
var logger = gulu.Log.NewLogger(os.Stdout)

// Version of Pipe.
const Version = "1.9.0"
const Version = "1.9.1"

// Conf of Pipe.
var Conf *Configuration
Expand Down
26 changes: 26 additions & 0 deletions service/upgradesrv.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,37 @@ func (srv *upgradeService) Perform() {
fallthrough
case "1.8.9":
perform189_190()
fallthrough
case "1.9.0":
perform190_191()
default:
logger.Fatalf("please upgrade to v1.8.7 first")
}
}

func perform190_191() {
fromVer := "1.9.0"
logger.Infof("upgrading from version [" + fromVer + "] to version [" + model.Version + "]....")

var verSettings []model.Setting
if err := db.Model(&model.Setting{}).Where("`name`= ?", model.SettingNameSystemVer).Find(&verSettings).Error; nil != err {
logger.Fatalf("load settings failed: %s", err)
}

tx := db.Begin()
for _, setting := range verSettings {
setting.Value = model.Version
if err := tx.Save(setting).Error; nil != err {
tx.Rollback()

logger.Fatalf("update setting [%+v] failed: %s", setting, err.Error())
}
}
tx.Commit()

logger.Infof("upgraded from version [" + fromVer + "] to version [" + model.Version + "] successfully")
}

func perform189_190() {
fromVer := "1.8.9"
logger.Infof("upgrading from version [" + fromVer + "] to version [" + model.Version + "]....")
Expand Down
2 changes: 1 addition & 1 deletion theme/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion theme/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Pipe",
"version": "1.9.0",
"version": "1.9.1",
"description": "Pipe theme",
"homepage": "https://github.com/88250/pipe",
"repository": {
Expand Down

0 comments on commit 34137c3

Please sign in to comment.