Remove Favicon There was a discussion around this in the IRC channel, which I agree with. The only reason I supported it was bc it was relatively popular
alex wennerberg alex@alexwennerberg.com
Sat, 20 Feb 2021 16:15:12 -0800
4 files changed,
2 insertions(+),
20 deletions(-)
M
http.go
→
http.go
@@ -528,19 +528,6 @@ return
} } -func getFavicon(user string) string { - faviconPath := path.Join(c.FilesDirectory, filepath.Clean(user), "favicon.txt") - content, err := ioutil.ReadFile(faviconPath) - if err != nil { - return "" - } - strcontent := []rune(string(content)) - if len(strcontent) > 0 { - return string(strcontent[0]) - } - return "" -} - // Server a user's file // TODO replace with gemini proxy // Here be dragons@@ -612,7 +599,6 @@ } else {
parse, _ := gmi.ParseText(strings.NewReader(geminiContent)) htmlDoc = textToHTML(nil, parse) } - favicon := getFavicon(userName) hostname := strings.Split(r.Host, ":")[0] uri := url.URL{ Scheme: "gemini",@@ -624,12 +610,11 @@ htmlDoc.Title = userName + p
} data := struct { SiteBody template.HTML - Favicon string PageTitle string URI *url.URL GeminiURI *url.URL Config Config - }{template.HTML(htmlDoc.Content), favicon, htmlDoc.Title, &uri, &uri, c} + }{template.HTML(htmlDoc.Content), htmlDoc.Title, &uri, &uri, c} buff := bytes.NewBuffer([]byte{}) err = t.ExecuteTemplate(buff, "user_page.html", data) if err != nil {
M
proxy.go
→
proxy.go
@@ -125,12 +125,11 @@ r.URL.Path = path.Dir(r.URL.Path)
} data := struct { SiteBody template.HTML - Favicon string PageTitle string GeminiURI *url.URL URI *url.URL Config Config - }{template.HTML(htmlDoc.Content), "", htmlDoc.Title, req.URL, r.URL, c} + }{template.HTML(htmlDoc.Content), htmlDoc.Title, req.URL, r.URL, c} err = t.ExecuteTemplate(w, "user_page.html", data) if err != nil {
M
templates/emptyfolder.html
→
templates/emptyfolder.html
@@ -5,7 +5,6 @@ <meta charset="utf-8" />
<title>{{.PageTitle }}</title> <meta name="viewport" content="width=device-width" /> <link rel="stylesheet" type="text/css" href="/style.css" /> - <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>{{.Favicon}}</text></svg>"> </head> <body> <main>
M
templates/user_page.html
→
templates/user_page.html
@@ -10,7 +10,6 @@ href="./atom.xml" />
{{ end }} <meta name="viewport" content="width=device-width" /> <link rel="stylesheet" type="text/css" href="//{{.Config.Host}}/style.css" /> - <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>{{.Favicon}}</text></svg>"> </head> <body> <main>