mirror of
https://codeberg.org/gothub/gothub
synced 2024-12-06 19:16:24 +01:00
fix up the view on github thing on unsupported routes
This commit is contained in:
+2
-2
@@ -4,8 +4,8 @@ import (
|
||||
"html/template"
|
||||
"log"
|
||||
"os"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"codeberg.org/gothub/gothub/pages"
|
||||
@@ -45,7 +45,7 @@ func Serve(port string) {
|
||||
if e, ok := err.(*fiber.Error); ok {
|
||||
code = e.Code
|
||||
}
|
||||
_, link := regexp.MatchString(`\/.*\ `, err.Error())
|
||||
link := strings.TrimPrefix(err.Error(), "Cannot GET ")
|
||||
err = ctx.Status(code).Render("error", fiber.Map{
|
||||
"error": err,
|
||||
"link": link,
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
<a href="https://codeberg.org/gothub/gothub/issues" target="_blank"
|
||||
>Create an issue on Codeberg.</a
|
||||
>
|
||||
{{ if .link }} Or view this page on
|
||||
<a rel="noreferrer" href="https://github.com{{.link}}">GitHub</a> {{end}}
|
||||
</h3>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user