Add OpenGraph assets

This commit is contained in:
Ben Visness 2023-06-01 13:56:35 -05:00
parent bb31644d6d
commit 2d61286831
5 changed files with 15 additions and 3 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

View File

@ -105,11 +105,11 @@ func BuildJamFeed2022() string {
return Url("/jam/2022/feed", nil) return Url("/jam/2022/feed", nil)
} }
var RegexTimeMachine = regexp.MustCompile("^/time-machine$") var RegexTimeMachine = regexp.MustCompile("^/timemachine$")
func BuildTimeMachine() string { func BuildTimeMachine() string {
defer CatchPanic() defer CatchPanic()
return Url("/time-machine", nil) return Url("/timemachine", nil)
} }
// QUESTION(ben): Can we change these routes? // QUESTION(ben): Can we change these routes?

View File

@ -89,7 +89,19 @@ func Conferences(c *RequestContext) ResponseData {
} }
func TimeMachine(c *RequestContext) ResponseData { func TimeMachine(c *RequestContext) ResponseData {
baseData := getBaseDataAutocrumb(c, "Time Machine")
baseData.OpenGraphItems = []templates.OpenGraphItem{
{Property: "og:title", Value: "Time Machine"},
{Property: "og:site_name", Value: "Handmade Network"},
{Property: "og:type", Value: "website"},
{Property: "og:image", Value: hmnurl.BuildPublic("timemachine/opengraph.png", true)},
{Property: "og:description", Value: "This summer, dig out your old devices and see what they were actually like to use."},
{Property: "og:url", Value: hmnurl.BuildTimeMachine()},
{Name: "twitter:card", Value: "summary_large_image"},
{Name: "twitter:image", Value: hmnurl.BuildPublic("timemachine/twittercard.png", true)},
}
var res ResponseData var res ResponseData
res.MustWriteTemplate("time-machine.html", getBaseDataAutocrumb(c, "Time Machine"), c.Perf) res.MustWriteTemplate("time-machine.html", baseData, c.Perf)
return res return res
} }