2022-01-18 00:07:07 +00:00
|
|
|
package pages
|
|
|
|
|
2022-01-28 01:41:10 +00:00
|
|
|
import (
|
2022-06-05 00:56:04 +00:00
|
|
|
"os"
|
|
|
|
|
2022-01-28 01:41:10 +00:00
|
|
|
"codeberg.org/video-prize-ranch/rimgo/utils"
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
|
|
)
|
2022-01-18 00:07:07 +00:00
|
|
|
|
2022-02-23 00:06:39 +00:00
|
|
|
func HandleFrontpage(c *fiber.Ctx) error {
|
2022-01-28 01:41:10 +00:00
|
|
|
utils.SetHeaders(c)
|
|
|
|
c.Set("Cache-Control", "public,max-age=31557600")
|
2022-04-10 15:21:41 +00:00
|
|
|
c.Set("Content-Security-Policy", "default-src 'none'; style-src 'self'; img-src 'self'; font-src 'self'; manifest-src 'self'; block-all-mixed-content")
|
2022-01-18 00:07:07 +00:00
|
|
|
|
2022-02-02 15:53:33 +00:00
|
|
|
return c.Render("frontpage", fiber.Map{
|
2022-03-22 20:56:27 +00:00
|
|
|
"proto": c.Protocol(),
|
2022-02-02 15:53:33 +00:00
|
|
|
"domain": c.Hostname(),
|
2022-06-05 00:56:04 +00:00
|
|
|
"force_webp": os.Getenv("FORCE_WEBP"),
|
2022-02-02 15:53:33 +00:00
|
|
|
})
|
2022-01-18 00:07:07 +00:00
|
|
|
}
|