2023-12-09 16:25:38 +00:00
|
|
|
package routes
|
|
|
|
|
|
|
|
import (
|
2024-03-19 20:16:26 +00:00
|
|
|
"log"
|
|
|
|
|
2024-01-18 17:01:30 +00:00
|
|
|
"git.matterlinux.xyz/Matter/website/lib"
|
2023-12-09 16:25:38 +00:00
|
|
|
"github.com/gofiber/fiber/v2"
|
|
|
|
)
|
|
|
|
|
|
|
|
func IndexRoute(c *fiber.Ctx) error{
|
2024-01-06 20:20:58 +00:00
|
|
|
con, err := lib.GetContent("", "index")
|
2023-12-09 16:25:38 +00:00
|
|
|
if err != nil {
|
2024-03-19 20:16:26 +00:00
|
|
|
log.Printf("GetContent failed: %s", err.Error())
|
2024-01-06 20:20:58 +00:00
|
|
|
return lib.RenderError(c, 500)
|
2023-12-09 16:25:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return c.Render("index", fiber.Map{
|
2024-01-06 20:20:58 +00:00
|
|
|
"readme": con,
|
2023-12-09 16:25:38 +00:00
|
|
|
})
|
|
|
|
}
|