templates: show page-specific title in og:title
field
Signed-off-by: Naman Sood <mail@nsood.in>
This commit is contained in:
parent
791a1db58b
commit
c9568c39f9
2 changed files with 3 additions and 3 deletions
|
@ -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) {
|
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"])
|
contents, err := p.render(s.templates["fullpost"])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.errorInRequest(res, req, err)
|
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) {
|
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
|
var posts string
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<meta name="keywords" content="nsood, nfool, naman sood, nachloride, nsdcars5, namansood, namandoesnotpanic, tendstofortytwo, prose, blog">
|
<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:url" content="https://prose.nsood.in">
|
||||||
<meta property="og:type" content="website">
|
<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="twitter:creator" content="@tendstofortytwo">
|
||||||
<meta name="color-scheme" content="dark light">
|
<meta name="color-scheme" content="dark light">
|
||||||
<meta name="viewport" content="width=device-width">
|
<meta name="viewport" content="width=device-width">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue