From 220ecd847a5f1718c352ceca7396214803dbff01 Mon Sep 17 00:00:00 2001 From: video-prize-ranch Date: Wed, 2 Feb 2022 10:53:33 -0500 Subject: [PATCH] Use instance domain on frontpage --- pages/frontpage.go | 5 ++++- views/frontpage.hbs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pages/frontpage.go b/pages/frontpage.go index 325f600..66fcbb4 100644 --- a/pages/frontpage.go +++ b/pages/frontpage.go @@ -10,5 +10,8 @@ func FrontpageHandler(c *fiber.Ctx) error { c.Set("Cache-Control", "public,max-age=31557600") c.Set("Content-Security-Policy", "default-src 'none'; style-src 'self'; img-src 'self'; font-src 'self'; block-all-mixed-content") - return c.Render("frontpage", fiber.Map{}) + return c.Render("frontpage", fiber.Map{ + "proto": c.Protocol(), + "domain": c.Hostname(), + }) } \ No newline at end of file diff --git a/views/frontpage.hbs b/views/frontpage.hbs index 480f006..d7bd354 100644 --- a/views/frontpage.hbs +++ b/views/frontpage.hbs @@ -47,7 +47,7 @@
  • Description: Imgur -> rimgo
  • Example URL: https://imgur.com/a/H8M4rcp
  • Include pattern: ^https?://(i|).?imgur.com(/.*)?$
  • -
  • Redirect to: https://[INSTANCE DOMAIN]$2
  • +
  • Redirect to: https://{{domain}}$2
  • Pattern type: Regular Expression