mirror of
https://codeberg.org/aryak/mozhi
synced 2024-11-23 04:32:58 +05:30
add about page
This commit is contained in:
parent
527877a321
commit
6c509efcd2
9
pages/about.go
Normal file
9
pages/about.go
Normal 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{})
|
||||||
|
}
|
@ -84,6 +84,7 @@ func Serve(port string) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
app.Get("/", pages.HandleIndex)
|
app.Get("/", pages.HandleIndex)
|
||||||
|
app.Get("/about", pages.HandleAbout)
|
||||||
app.Get("/switchlanguages", func(c *fiber.Ctx) error {
|
app.Get("/switchlanguages", func(c *fiber.Ctx) error {
|
||||||
engine := c.Query("engine")
|
engine := c.Query("engine")
|
||||||
from := c.Query("from")
|
from := c.Query("from")
|
||||||
@ -95,7 +96,6 @@ func Serve(port string) {
|
|||||||
MaxAge: 2592000,
|
MaxAge: 2592000,
|
||||||
Root: http.FS(public.GetFiles()),
|
Root: http.FS(public.GetFiles()),
|
||||||
}))
|
}))
|
||||||
// app.Get("/about", pages.HandleAbout)
|
|
||||||
|
|
||||||
api := app.Group("/api")
|
api := app.Group("/api")
|
||||||
api.Get("/translate", pages.HandleTranslate)
|
api.Get("/translate", pages.HandleTranslate)
|
||||||
|
12
views/about.html
Normal file
12
views/about.html
Normal 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" .}}
|
Loading…
Reference in New Issue
Block a user