feat(external plugins): worked on supporting external plugins better
This commit is contained in:
+6
-5
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user