~sircmpwn/gmni-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch

[PATCH kineto] Implement support for "lang" media type parameter

Details
Message ID
<20210224232813.21664-1-me@adnano.co>
DKIM signature
pass
Download raw message
Patch: +5 -1
---
 main.go | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/main.go b/main.go
index 47c35d5..fd02310 100644
--- a/main.go
+++ b/main.go
@@ -131,7 +131,7 @@ var gemtextPage = template.Must(template.
</style>
{{- end }}
<title>{{.Title}}</title>
<article>
<article{{if .Lang}} lang="{{.Lang}}"{{end}}>
	{{ $ctx := . -}}
	{{- $isList := false -}}
	{{- range .Lines -}}
@@ -364,6 +364,7 @@ type GemtextContext struct {
	Pre      int
	Resp     *gemini.Response
	Title    string
	Lang     string
	URL      *url.URL
	Root     *url.URL
}
@@ -476,12 +477,15 @@ func proxyGemini(req gemini.Request, external bool, root *url.URL,
		}
	}

	lang := params["lang"]

	w.Header().Add("Content-Type", "text/html")
	ctx := &GemtextContext{
		CSS:      css,
		External: external,
		Resp:     resp,
		Title:    req.URL.Host + " " + req.URL.Path,
		Lang:     lang,
		URL:      req.URL,
		Root:     root,
	}
-- 
2.30.1
Reply to thread Export thread (mbox)