all repos — flounder @ ae1e33aa0df0fd919af8cf9ea1cebcd708900c9e

A small site builder for the Gemini protocol

fix scheme links for local flounder
alex wennerberg alex@alexwennerberg.com
Wed, 06 Jan 2021 23:40:45 -0800
commit

ae1e33aa0df0fd919af8cf9ea1cebcd708900c9e

parent

d8647e6a087a23309305a5a0c7075c7e7ddf9ed4

1 files changed, 9 insertions(+), 4 deletions(-)

jump to
M gmi2html.gogmi2html.go

@@ -33,10 +33,15 @@ if err != nil {

continue } if u.Scheme == "gemini" { - u.Path = fmt.Sprintf("/%s%s", u.Host, u.Path) - u.Scheme = "" - u.Host = "proxy." + c.Host - urlstring = html.EscapeString(u.String()) + if strings.HasSuffix(u.Host, c.Host) { + u.Scheme = "" + urlstring = html.EscapeString(u.String()) + } else { + u.Path = fmt.Sprintf("/%s%s", u.Host, u.Path) + u.Scheme = "" + u.Host = "proxy." + c.Host + urlstring = html.EscapeString(u.String()) + } } name := html.EscapeString(link.Name) if name == "" {