From 7d2136a973e00e7cdeda80371219ce1f1d7cc5f2 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Wed, 29 Nov 2017 14:44:02 +0100 Subject: [PATCH] Improved open graph data --- pages/company/company.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pages/company/company.go b/pages/company/company.go index 13e507af..d6052687 100644 --- a/pages/company/company.go +++ b/pages/company/company.go @@ -21,10 +21,11 @@ func Get(ctx *aero.Context) string { openGraph := &arn.OpenGraph{ Tags: map[string]string{ - "og:title": company.Name.English, - "og:url": "https://" + ctx.App.Config.Domain + company.Link(), - "og:site_name": "notify.moe", - "og:type": "article", + "og:title": company.Name.English, + "og:description": company.Description, + "og:url": "https://" + ctx.App.Config.Domain + company.Link(), + "og:site_name": "notify.moe", + "og:type": "article", }, } @@ -32,6 +33,12 @@ func Get(ctx *aero.Context) string { openGraph.Tags["og:image"] = company.Image } + if company.Description != "" { + openGraph.Tags["og:description"] = company.Description + } else { + openGraph.Tags["og:description"] = company.Name.English + " company information." + } + ctx.Data = openGraph return ctx.HTML(components.CompanyPage(company, user)) }