templates: show page-specific title in og:title field

Signed-off-by: Naman Sood <mail@nsood.in>
This commit is contained in:
Naman Sood 2021-04-26 00:34:22 -04:00
parent 791a1db58b
commit c9568c39f9
2 changed files with 3 additions and 3 deletions

View file

@ -128,7 +128,7 @@ func (s *server) createWebPage(title, contents string) (string, error) {
}
func (s *server) postPage(p *Post, res http.ResponseWriter, req *http.Request) {
res.Header().Add("content-type", "text/html")
res.Header().Add("content-type", "text/html; charset=utf-8")
contents, err := p.render(s.templates["fullpost"])
if err != nil {
s.errorInRequest(res, req, err)
@ -141,7 +141,7 @@ func (s *server) postPage(p *Post, res http.ResponseWriter, req *http.Request) {
}
func (s *server) homePage(res http.ResponseWriter, req *http.Request) {
res.Header().Add("content-type", "text/html")
res.Header().Add("content-type", "text/html; charset=utf-8")
var posts string

View file

@ -5,7 +5,7 @@
<meta name="keywords" content="nsood, nfool, naman sood, nachloride, nsdcars5, namansood, namandoesnotpanic, tendstofortytwo, prose, blog">
<meta property="og:url" content="https://prose.nsood.in">
<meta property="og:type" content="website">
<meta property="og:title" content="Prose">
<meta property="og:title" content="{{title}} Prose">
<meta name="twitter:creator" content="@tendstofortytwo">
<meta name="color-scheme" content="dark light">
<meta name="viewport" content="width=device-width">