add about page

This commit is contained in:
Arya Kiran 2023-09-10 20:43:48 +05:30
parent 527877a321
commit 6c509efcd2
No known key found for this signature in database
GPG key ID: 842D12BDA50DF120
3 changed files with 22 additions and 1 deletions

9
pages/about.go Normal file
View file

@ -0,0 +1,9 @@
package pages
import (
"github.com/gofiber/fiber/v2"
)
func HandleAbout(c *fiber.Ctx) error {
return c.Render("about", fiber.Map{})
}

View file

@ -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)

12
views/about.html Normal file
View file

@ -0,0 +1,12 @@
{{template "header" .}}
<main>
<h1>About Mozhi</h1>
<h2>What is Mozhi?</h2>
<p>Mozhi is an alternative frontend for many translation engines such as google, yandex, duckduckgo, libretranslate and more!</p>
<h2>Why would I use this over just directly accessing the engine in question</h2>
<p>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.</p>
<p>However, there are other reasons to use it as well.</p>
<p>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.</p>
</main>
{{ template "footer" .}}