diff --git a/CONFIGURATION.md b/CONFIGURATION.md index dee59a4..de5d64d 100644 --- a/CONFIGURATION.md +++ b/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. diff --git a/config.go b/config.go index e50e6bc..20203d4 100644 --- a/config.go +++ b/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")