all repos — flounder @ b4f33f25296d7486bd118caf9537f96842b15416

A small site builder for the Gemini protocol

Add note about proxy on the bottom of each page
alex wennerberg alex@alexwennerberg.com
Sun, 13 Dec 2020 16:43:38 -0800
commit

b4f33f25296d7486bd118caf9537f96842b15416

parent

3c292c8b767eb438c0de7f6c198514eeced63a7f

3 files changed, 12 insertions(+), 1 deletions(-)

jump to
M http.gohttp.go

@@ -540,11 +540,14 @@ if !raw && !acceptsGemini && (extension == ".gmi" || extension == ".gemini") {

file, _ := os.Open(fileName) htmlString := textToHTML(gmi.ParseText(file)) favicon := getFavicon(userName) + hostname := strings.Split(r.Host, ":")[0] + URI := hostname + r.URL.String() data := struct { SiteBody template.HTML Favicon string PageTitle string - }{template.HTML(htmlString), favicon, userName + p} + URI string + }{template.HTML(htmlString), favicon, userName + p, URI} t.ExecuteTemplate(w, "user_page.html", data) } else { http.ServeFile(w, r, fileName)
M templates/static/style.csstemplates/static/style.css

@@ -13,6 +13,12 @@ margin-top:0;

margin-bottom:.2em; } +.footer { + font-style: italic; + color: grey; + font-size: .9em; +} + body { }
M templates/user_page.htmltemplates/user_page.html

@@ -10,6 +10,8 @@ </head>

<body> <main> {{.SiteBody}} +<div class="footer"> + Proxied from the original at <a href="gemini://{{.URI}}">{{.URI}}</a> (<a href="https://admin.flounder.online/gemini.gmi">about Gemini</a>)</div> </main> </body> </html>