Exemplo n.º 1
0
func upgrade_20140130(app *GoInk.App) bool {

	// change settings
	model.LoadSettings()
	model.SetSetting("c_footer_ga", "<!-- google analytics or other -->")
	model.SetSetting("enable_go_markdown", "false")
	model.SetSetting("enable_go_markdown_def", "false")
	model.SetSetting("site_theme", "default")
	model.SetSetting("site_theme_def", "default")
	model.SetSetting("c_home_avatar", "/static/img/site.png")
	model.SyncSettings()

	// init plugin
	plugin.Init()
	model.Storage.Dir("plugin")

	// remove static files
	os.RemoveAll(app.Get("view_dir"))
	os.RemoveAll(path.Join(app.Get("static_dir"), "less"))
	os.RemoveAll(path.Join(app.Get("static_dir"), "css"))
	os.RemoveAll(path.Join(app.Get("static_dir"), "img"))
	os.RemoveAll(path.Join(app.Get("static_dir"), "js"))
	os.RemoveAll(path.Join(app.Get("static_dir"), "lib"))
	os.Remove(path.Join(app.Get("static_dir"), "favicon.ico"))

	// extract current static files
	cmd.ExtractBundleBytes()

	// "c_footer_ga":        "<!-- google analytics or other -->",
	// "enable_go_markdown": "true",
	// "enable_go_markdown_def": "false",
	// "site_theme": "ling",
	// "site_theme_def": "default",
	return true
}
Exemplo n.º 2
0
func upgrade_20140228(_ *GoInk.App) bool {

	// change settings
	model.LoadSettings()
	model.SetSetting("popular_size", "4")
	model.SetSetting("recent_comment_size", "3")
	model.SetSetting("theme_cache", "false")
	model.SyncSettings()

	// overwrite zip bundle bytes
	cmd.ExtractBundleBytes()
	return true
}
Exemplo n.º 3
0
func upgrade_20140209(app *GoInk.App) bool {
	// clean template
	vDir := app.Get("view_dir")
	os.Remove(path.Join(vDir, "admin.layout"))
	os.Remove(path.Join(vDir, "cmd.layout"))

	// write default menu setting
	model.DefaultNavigators()

	// write message storage
	model.Storage.Set("messages", []*model.Message{})

	cmd.ExtractBundleBytes()
	return true
}
Exemplo n.º 4
0
func upgrade_20140131(app *GoInk.App) bool {

	// re-write all data to non-indent json
	/*model.All()
	model.SyncContents()
	model.SyncFiles()
	model.SyncReaders()
	model.SyncSettings()
	model.SyncTokens()
	model.SyncUsers()
	model.SyncVersion()*/

	// update ling template
	os.RemoveAll(path.Join(app.Get("view_dir"), "ling"))
	cmd.ExtractBundleBytes()

	return true
}