use themes
This commit is contained in:
23
routers/router.go
Normal file
23
routers/router.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package routers // Add the package declaration at the top
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func RegisterRoutes(r *gin.Engine) {
|
||||
// Frontend routes (dynamic themes)
|
||||
r.GET("/", handlers.Home)
|
||||
r.GET("/post/:id", handlers.ShowPost)
|
||||
|
||||
// Admin panel
|
||||
admin := r.Group("/admin", middleware.AuthRequired())
|
||||
{
|
||||
admin.GET("/themes", handlers.ListThemes)
|
||||
admin.POST("/themes/switch", handlers.SwitchTheme)
|
||||
}
|
||||
|
||||
// Static files for themes
|
||||
r.StaticFS("/themes", http.Dir("web/themes"))
|
||||
}
|
||||
Reference in New Issue
Block a user