summaryrefslogtreecommitdiff
path: root/files.go
diff options
context:
space:
mode:
authortjp <tjp@ctrl-c.club>2024-01-09 09:53:15 -0700
committertjp <tjp@ctrl-c.club>2024-01-09 09:53:15 -0700
commita44a063c1a60ca11066d21d49aca95cfed7d3499 (patch)
tree65bcb597fd77e27a2c93ca10ce06a0add80d9384 /files.go
parent15214b7c98cbe77bddb2a52e0849abdfa7953747 (diff)
mimetype handling
upon general navigation: 1. check for any configured handlers for the mimetype 2. normal printing for gophermap, gemtext, and text/plain 3. save the file to downloads folder
Diffstat (limited to 'files.go')
-rw-r--r--files.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/files.go b/files.go
index 5ddf53b..052c4fb 100644
--- a/files.go
+++ b/files.go
@@ -26,6 +26,8 @@ type ConfigMain struct {
type Config struct {
ConfigMain `toml:"main"`
+
+ Handlers map[string]string `toml:"handlers"`
}
func getConfig() (*Config, error) {
@@ -41,7 +43,7 @@ func getConfig() (*Config, error) {
}
c := Config{
- ConfigMain{
+ ConfigMain: ConfigMain{
VimKeys: true,
DefaultScheme: "gemini",
SoftWrap: 100,
@@ -49,6 +51,7 @@ func getConfig() (*Config, error) {
Quiet: false,
Pager: "auto",
},
+ Handlers: map[string]string{},
}
if _, err := toml.DecodeFile(path, &c); err != nil {
return nil, err