mirror of
https://code.rocketnine.space/tslocum/twins.git
synced 2024-11-27 12:48:13 +01:00
Add configuration option ShowImages
When enabled, clients accessing gemini pages via HTTPS will see links to images as inline images. Resolves #13.
This commit is contained in:
parent
0c4c7e8ecb
commit
24f3196a61
2 changed files with 9 additions and 0 deletions
|
@ -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
|
Content types may be defined by file extension. When a type is not defined for
|
||||||
the requested file extension, content type is detected automatically.
|
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
|
||||||
|
|
||||||
Hosts are defined by their hostname followed by one or more paths to serve.
|
Hosts are defined by their hostname followed by one or more paths to serve.
|
||||||
|
|
|
@ -11,6 +11,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"code.rocketnine.space/tslocum/gmitohtml/pkg/gmitohtml"
|
||||||
"github.com/kballard/go-shellquote"
|
"github.com/kballard/go-shellquote"
|
||||||
"github.com/yookoala/gofast"
|
"github.com/yookoala/gofast"
|
||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
|
@ -76,6 +77,7 @@ type hostConfig struct {
|
||||||
type serverConfig struct {
|
type serverConfig struct {
|
||||||
Listen string
|
Listen string
|
||||||
Types map[string]string
|
Types map[string]string
|
||||||
|
ShowImages bool
|
||||||
Hosts map[string]*hostConfig
|
Hosts map[string]*hostConfig
|
||||||
DisableHTTPS bool
|
DisableHTTPS bool
|
||||||
DisableSize bool
|
DisableSize bool
|
||||||
|
@ -151,6 +153,8 @@ func readconfig(configPath string) error {
|
||||||
config.Types[".gemini"] = geminiType
|
config.Types[".gemini"] = geminiType
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gmitohtml.Config.ConvertImages = config.ShowImages
|
||||||
|
|
||||||
defaultHost := config.Hosts["default"]
|
defaultHost := config.Hosts["default"]
|
||||||
delete(config.Hosts, "default")
|
delete(config.Hosts, "default")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue