From 6c509efcd2b6d2db206882bd71f956fc29f340e1 Mon Sep 17 00:00:00 2001 From: Arya Kiran Date: Sun, 10 Sep 2023 20:43:48 +0530 Subject: [PATCH] add about page --- pages/about.go | 9 +++++++++ serve/serve.go | 2 +- views/about.html | 12 ++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 pages/about.go create mode 100644 views/about.html diff --git a/pages/about.go b/pages/about.go new file mode 100644 index 0000000..a1d9b42 --- /dev/null +++ b/pages/about.go @@ -0,0 +1,9 @@ +package pages + +import ( + "github.com/gofiber/fiber/v2" +) + +func HandleAbout(c *fiber.Ctx) error { + return c.Render("about", fiber.Map{}) +} diff --git a/serve/serve.go b/serve/serve.go index dd23252..b937abf 100644 --- a/serve/serve.go +++ b/serve/serve.go @@ -84,6 +84,7 @@ func Serve(port string) { }) app.Get("/", pages.HandleIndex) + app.Get("/about", pages.HandleAbout) app.Get("/switchlanguages", func(c *fiber.Ctx) error { engine := c.Query("engine") from := c.Query("from") @@ -95,7 +96,6 @@ func Serve(port string) { MaxAge: 2592000, Root: http.FS(public.GetFiles()), })) - // app.Get("/about", pages.HandleAbout) api := app.Group("/api") api.Get("/translate", pages.HandleTranslate) diff --git a/views/about.html b/views/about.html new file mode 100644 index 0000000..457932a --- /dev/null +++ b/views/about.html @@ -0,0 +1,12 @@ +{{template "header" .}} +
+

About Mozhi

+

What is Mozhi?

+

Mozhi is an alternative frontend for many translation engines such as google, yandex, duckduckgo, libretranslate and more!

+ +

Why would I use this over just directly accessing the engine in question

+

There are many reasons why using an alternative-frontend like mozhi is superior to directly accessing the service in question, and the biggest and most obvious reason is of course, privacy.

+

However, there are other reasons to use it as well.

+

In many cases, different translation engines can give vastly different results for the given text, and in some cases where you need the most accurate/poetic translation, having the ability to have the output of all the engines right in front of you is extremely useful.

+
+{{ template "footer" .}}