Add documentation for FORCE_WEBP

This commit is contained in:
video-prize-ranch 2022-06-04 20:56:04 -04:00
parent de49f1c647
commit ceabddc972
No known key found for this signature in database
GPG Key ID: D8EAA4C5B12A7281
3 changed files with 8 additions and 0 deletions

View File

@ -23,6 +23,7 @@ It's read-only and works without JavaScript. Images and albums can be viewed wit
- Albums - Albums
- User page - User page
- Tag page - Tag page
- Bandwidth efficient - automatically use WebP with the `FORCE_WEBP` environment variable
Some things left to implement (contributions welcome!): Some things left to implement (contributions welcome!):

View File

@ -1,6 +1,8 @@
package pages package pages
import ( import (
"os"
"codeberg.org/video-prize-ranch/rimgo/utils" "codeberg.org/video-prize-ranch/rimgo/utils"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
) )
@ -13,5 +15,6 @@ func HandleFrontpage(c *fiber.Ctx) error {
return c.Render("frontpage", fiber.Map{ return c.Render("frontpage", fiber.Map{
"proto": c.Protocol(), "proto": c.Protocol(),
"domain": c.Hostname(), "domain": c.Hostname(),
"force_webp": os.Getenv("FORCE_WEBP"),
}) })
} }

View File

@ -43,6 +43,10 @@
<p>Just replace imgur.com or i.imgur.com with <code>{{domain}}</code>! You can setup automatic redirects using <a <p>Just replace imgur.com or i.imgur.com with <code>{{domain}}</code>! You can setup automatic redirects using <a
href="https://github.com/libredirect/libredirect">LibRedirect</a> (recommended) or <a href="https://github.com/einaregilsson/Redirector">Redirector</a>.</p> href="https://github.com/libredirect/libredirect">LibRedirect</a> (recommended) or <a href="https://github.com/einaregilsson/Redirector">Redirector</a>.</p>
<br>
{{#if force_webp}}
<p>To download images as their original filetype, add <code>?no_webp=1</code> to the end of the image URL.</p>
{{/if}}
<br> <br>
<details> <details>