feat(external plugins): worked on supporting external plugins better

This commit is contained in:
Torkel Ödegaard
2015-11-19 18:44:07 +01:00
parent 65a7fa320a
commit 69daede583
13 changed files with 58 additions and 60 deletions
+6 -5
View File
@@ -29,6 +29,12 @@ func newMacaron() *macaron.Macaron {
m.Use(middleware.Gziper())
}
for _, route := range plugins.StaticRoutes {
pluginRoute := path.Join("/public/plugins/", route.Url)
log.Info("Plugin: Adding static route %s -> %s", pluginRoute, route.Path)
mapStatic(m, route.Path, "", pluginRoute)
}
mapStatic(m, setting.StaticRootPath, "", "public")
mapStatic(m, setting.StaticRootPath, "app", "app")
mapStatic(m, setting.StaticRootPath, "css", "css")
@@ -36,11 +42,6 @@ func newMacaron() *macaron.Macaron {
mapStatic(m, setting.StaticRootPath, "fonts", "fonts")
mapStatic(m, setting.StaticRootPath, "robots.txt", "robots.txt")
for _, route := range plugins.StaticRoutes {
log.Info("Adding plugin static route %s -> %s", route.Url, route.Path)
mapStatic(m, route.Path, "", route.Url)
}
m.Use(macaron.Renderer(macaron.RenderOptions{
Directory: path.Join(setting.StaticRootPath, "views"),
IndentJSON: macaron.Env != macaron.PROD,