Browse Source

Add configuration option ShowImages

When enabled, clients accessing gemini pages via HTTPS will see links to
images as inline images.

Resolves #13.
master
Trevor Slocum 2 months ago
parent
commit
24f3196a61
  1. 5
      CONFIGURATION.md
  2. 4
      config.go

5
CONFIGURATION.md

@ -23,6 +23,11 @@ Address to listen for connections on in the format of `interface:port`.
Content types may be defined by file extension. When a type is not defined for
the requested file extension, content type is detected automatically.
## ShowImages
When enabled, clients accessing gemini pages via HTTPS will see links to images
as inline images.
## Hosts
Hosts are defined by their hostname followed by one or more paths to serve.

4
config.go

@ -11,6 +11,7 @@ import (
"strconv"
"strings"
"code.rocketnine.space/tslocum/gmitohtml/pkg/gmitohtml"
"github.com/kballard/go-shellquote"
"github.com/yookoala/gofast"
"gopkg.in/yaml.v2"
@ -76,6 +77,7 @@ type hostConfig struct {
type serverConfig struct {
Listen string
Types map[string]string
ShowImages bool
Hosts map[string]*hostConfig
DisableHTTPS bool
DisableSize bool
@ -151,6 +153,8 @@ func readconfig(configPath string) error {
config.Types[".gemini"] = geminiType
}
gmitohtml.Config.ConvertImages = config.ShowImages
defaultHost := config.Hosts["default"]
delete(config.Hosts, "default")

Loading…
Cancel
Save