flounder

A simple gemini site builder
Log | Files | Refs | README | LICENSE

commit d8647e6a087a23309305a5a0c7075c7e7ddf9ed4
parent 1a867bb9b9fbf406d431b32799bd280c17d4a20a
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Wed,  6 Jan 2021 23:34:10 -0800

Merge branch 'main' into proxy

Diffstat:
Mhttp.go | 7++-----
Mtemplates/edit_file.html | 3+++
Mtemplates/my_site.html | 3+++
Mtemplates/user_page.html | 4++--
4 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/http.go b/http.go @@ -183,9 +183,10 @@ func editFileHandler(w http.ResponseWriter, r *http.Request) { AuthUser AuthUser Host string IsText bool + IsGemini bool Alert string Warnings []string - }{fileName, string(fileBytes), c.SiteTitle, user, c.Host, isText, alert, warnings} + }{fileName, string(fileBytes), c.SiteTitle, user, c.Host, isText, isGemini(fileName), alert, warnings} err = t.ExecuteTemplate(w, "edit_file.html", data) if err != nil { panic(err) @@ -552,10 +553,6 @@ func userFile(w http.ResponseWriter, r *http.Request) { renderDefaultError(w, http.StatusForbidden) return } - if r.URL.Path == "/style.css" { - http.ServeFile(w, r, path.Join(c.TemplatesDirectory, "static/style.css")) - return - } if r.URL.Path == "/gemlog/atom.xml" && os.IsNotExist(err) { w.Header().Set("Content-Type", "application/atom+xml") // TODO set always somehow diff --git a/templates/edit_file.html b/templates/edit_file.html @@ -11,6 +11,9 @@ {{ end }} </div> {{ if .IsText }} + {{ if .IsGemini }} + <em>For help with the Gemini markup format, see the <a href="https://admin.flounder.online/gemini_text_guide.gmi">Gemini Text Guide</a></em> + {{ end }} <textarea rows="27" name="file_text" id="editor">{{.FileText}}</textarea> {{ end }} <br> diff --git a/templates/my_site.html b/templates/my_site.html @@ -8,6 +8,9 @@ </h1> {{template "nav.html" .}} <br> +For some help building your site, check out the <a href="https://admin.flounder.online/tips_and_tricks.gmi">Tips and Tricks</a> page. +<br> +<br> <h3>Your files:</h3> {{ define "file" }} <tr> diff --git a/templates/user_page.html b/templates/user_page.html @@ -4,7 +4,7 @@ <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="stylesheet" type="text/css" href="https://flounder.online/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> @@ -12,7 +12,7 @@ {{.SiteBody}} <br> <div class="footer"> - Proxied from the original at <a href="gemini://{{.URI}}">gemini://{{.URI}}</a> (<a href="https://admin.flounder.online/gemini.gmi">about Gemini</a>)</div> + Proxied from the original at <a href="gemini://{{.URI}}">gemini://{{.URI}}</a> (<a href="https://admin.flounder.online/gemini.gmi">about Gemini</a>) <a href="./?raw=1">raw</a></div> </main> </body> </html>