nice clean recipes pear.dunkirk.sh
recipes
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add social tags

+17 -1
+2 -1
main.go
··· 93 93 http.Redirect(w, r, "/recipe?url="+url.QueryEscape(targetURL), http.StatusFound) 94 94 return 95 95 } 96 - s.templates.ExecuteTemplate(w, "index_page", map[string]string{"GitHash": s.gitHash}) 96 + s.templates.ExecuteTemplate(w, "index_page", map[string]string{"GitHash": s.gitHash, "BaseURL": s.baseURL}) 97 97 } 98 98 99 99 func (s *Server) handleRecipe(w http.ResponseWriter, r *http.Request) { ··· 127 127 "Recipe": recipe, 128 128 "TargetURL": targetURL, 129 129 "GitHash": s.gitHash, 130 + "BaseURL": s.baseURL, 130 131 } 131 132 132 133 w.Header().Set("Content-Type", "text/html; charset=utf-8")
ui/static/og.png

This is a binary file and will not be displayed.

+6
ui/templates/index.html
··· 7 7 <title>pare: nice recipes</title> 8 8 <link rel="icon" type="image/svg+xml" href="/static/favicon.svg"> 9 9 <link rel="stylesheet" href="/static/style.css"> 10 + <meta property="og:title" content="pare: nice recipes"> 11 + <meta property="og:type" content="website"> 12 + <meta property="og:image" content="{{.BaseURL}}/static/og.png"> 13 + <meta name="twitter:card" content="summary"> 14 + <meta name="twitter:title" content="pare: nice recipes"> 15 + <meta name="twitter:image" content="{{.BaseURL}}/static/og.png"> 10 16 </head> 11 17 <body> 12 18 <nav>
+9
ui/templates/recipe.html
··· 7 7 <title>{{.Recipe.Name}}</title> 8 8 <link rel="icon" type="image/svg+xml" href="/static/favicon.svg"> 9 9 <link rel="stylesheet" href="/static/style.css"> 10 + <meta property="og:title" content="{{.Recipe.Name}}"> 11 + <meta property="og:type" content="article"> 12 + <meta property="og:url" content="{{.BaseURL}}/recipe?url={{.TargetURL | urlquery}}"> 13 + {{if .Recipe.Description}}<meta property="og:description" content="{{.Recipe.Description}}">{{end}} 14 + {{if .Recipe.ImageURL}}<meta property="og:image" content="{{.Recipe.ImageURL}}">{{else}}<meta property="og:image" content="{{.BaseURL}}/static/og.png">{{end}} 15 + <meta name="twitter:card" content="{{if .Recipe.ImageURL}}summary_large_image{{else}}summary{{end}}"> 16 + <meta name="twitter:title" content="{{.Recipe.Name}}"> 17 + {{if .Recipe.Description}}<meta name="twitter:description" content="{{.Recipe.Description}}">{{end}} 18 + {{if .Recipe.ImageURL}}<meta name="twitter:image" content="{{.Recipe.ImageURL}}">{{else}}<meta name="twitter:image" content="{{.BaseURL}}/static/og.png">{{end}} 10 19 </head> 11 20 <body> 12 21 <nav>