diff options
author | Adnan Maolood <me@adnano.co> | 2021-02-24 18:28:14 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2021-02-25 08:51:58 -0500 |
commit | c2f510eb79a81bbf187126bac196932523c974f8 (patch) | |
tree | 22123eb9e1f34aea8ee1ea6236891508c205a003 | |
parent | Display an error on charsets other than UTF-8 (diff) | |
download | kineto-c2f510eb79a81bbf187126bac196932523c974f8.tar.bz2 kineto-c2f510eb79a81bbf187126bac196932523c974f8.zip |
Implement support for "lang" media type parameter
-rw-r--r-- | main.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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, } |