diff --git a/config/config.go b/config/config.go index 0ea7967..62e1ddc 100644 --- a/config/config.go +++ b/config/config.go @@ -199,6 +199,7 @@ func Init() error { viper.SetDefault("a-general.color", true) viper.SetDefault("a-general.ansi", true) viper.SetDefault("a-general.bullets", true) + viper.SetDefault("a-general.show_link", false) viper.SetDefault("a-general.left_margin", 0.15) viper.SetDefault("a-general.max_width", 100) viper.SetDefault("a-general.downloads", "") diff --git a/config/default.go b/config/default.go index d1c5c98..6b127dd 100644 --- a/config/default.go +++ b/config/default.go @@ -50,6 +50,9 @@ ansi = true # Whether to replace list asterisks with unicode bullets bullets = true +# Whether to show link after link text +show_link = false + # A number from 0 to 1, indicating what percentage of the terminal width the left margin should take up. left_margin = 0.15 diff --git a/default-config.toml b/default-config.toml index b9ec3d3..b649d6b 100644 --- a/default-config.toml +++ b/default-config.toml @@ -47,6 +47,9 @@ ansi = true # Whether to replace list asterisks with unicode bullets bullets = true +# Whether to show link after link text +show_link = false + # A number from 0 to 1, indicating what percentage of the terminal width the left margin should take up. left_margin = 0.15 diff --git a/renderer/renderer.go b/renderer/renderer.go index 8f41fdd..b21ecd9 100644 --- a/renderer/renderer.go +++ b/renderer/renderer.go @@ -134,6 +134,9 @@ func convertRegularGemini(s string, numLinks, width int, proxied bool) (string, // There is link text url = lines[i][:delim] linkText = strings.Trim(lines[i][delim:], " \t") + if viper.GetBool("a-general.show_link") { + linkText += " (" + url + ")" + } } if strings.TrimSpace(lines[i]) == "" || strings.TrimSpace(url) == "" {