server: crawler bots like descriptions
Signed-off-by: Naman Sood <mail@nsood.in>
This commit is contained in:
parent
cba3a7f4b3
commit
ee9392a2ba
2 changed files with 6 additions and 3 deletions
|
@ -117,9 +117,10 @@ func (s *server) errorInRequest(res http.ResponseWriter, req *http.Request, err
|
||||||
log.Printf("ERR %s: %s", req.URL.Path, err)
|
log.Printf("ERR %s: %s", req.URL.Path, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *server) createWebPage(title, contents string) (string, error) {
|
func (s *server) createWebPage(title, subtitle, contents string) (string, error) {
|
||||||
ctx := map[string]interface{}{
|
ctx := map[string]interface{}{
|
||||||
"title": title,
|
"title": title,
|
||||||
|
"subtitle": subtitle,
|
||||||
"contents": contents,
|
"contents": contents,
|
||||||
}
|
}
|
||||||
return s.templates["page"].Exec(ctx)
|
return s.templates["page"].Exec(ctx)
|
||||||
|
@ -131,7 +132,7 @@ func (s *server) postPage(p *Post, res http.ResponseWriter, req *http.Request) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.errorInRequest(res, req, err)
|
s.errorInRequest(res, req, err)
|
||||||
}
|
}
|
||||||
page, err := s.createWebPage(p.Metadata.Title, contents)
|
page, err := s.createWebPage(p.Metadata.Title, p.Metadata.Summary, contents)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.errorInRequest(res, req, err)
|
s.errorInRequest(res, req, err)
|
||||||
}
|
}
|
||||||
|
@ -151,7 +152,7 @@ func (s *server) homePage(res http.ResponseWriter, req *http.Request) {
|
||||||
posts = posts + summary
|
posts = posts + summary
|
||||||
}
|
}
|
||||||
|
|
||||||
page, err := s.createWebPage("Home", posts)
|
page, err := s.createWebPage("Home", "Where I infodump in Markdown and nobody can stop me.", posts)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.errorInRequest(res, req, err)
|
s.errorInRequest(res, req, err)
|
||||||
|
|
|
@ -3,9 +3,11 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<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 name="description" content="{{subtitle}}">
|
||||||
<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="{{title}} – Prose">
|
<meta property="og:title" content="{{title}} – Prose">
|
||||||
|
<meta property="og:description" content="{{subtitle}}">
|
||||||
<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