Merge pull request #1502 from sharelatex/jel-social-metatags

Update `og` metatags and add protocol to image URL

GitOrigin-RevId: 9548ca5f378cb770e454bc75062e80bd1c3da9ac
This commit is contained in:
Timothée Alby 2019-02-12 10:27:34 -05:00 committed by sharelatex
parent fb5caf7b63
commit c4dd8b5da8

View file

@ -73,24 +73,24 @@ meta(name="twitter:card", content=metadata && metadata.twitterCardType ? metadat
//- Open Graph //- Open Graph
//- to do - add og:url //- to do - add og:url
-if (settings.social && settings.social.facebook && settings.social.facebook.appId) -if (settings.social && settings.social.facebook && settings.social.facebook.appId)
meta(name="fb:app_id", content=settings.social.facebook.appId) meta(property="fb:app_id", content=settings.social.facebook.appId)
-if (metadata && metadata.openGraphDescription) -if (metadata && metadata.openGraphDescription)
meta(name="og:description", content=metadata.openGraphDescription) meta(property="og:description", content=metadata.openGraphDescription)
-else -else
meta(name="og:description", content=translate("site_description")) meta(property="og:description", content=translate("site_description"))
-if (metadata && metadata.openGraphImage) -if (metadata && metadata.openGraphImage)
//- from the CMS //- from the CMS
meta(name="og:image", content=metadata.openGraphImage.fields.file.url) meta(property="og:image", content=metadata.openGraphImage.fields.file.url)
-else if (settings.overleaf) -else if (settings.overleaf)
//- the default image for Overleaf //- the default image for Overleaf
meta(name="og:image", content=buildImgPath('ol-brand/overleaf_og_logo.png')) meta(property="og:image", content=buildImgPath('ol-brand/overleaf_og_logo.png'))
-else -else
//- the default image for ShareLaTeX //- the default image for ShareLaTeX
meta(name="og:image", content='/touch-icon-192x192.png') meta(property="og:image", content='/touch-icon-192x192.png')
-if (metadata && metadata.openGraphType) -if (metadata && metadata.openGraphType)
meta(name="og:type", metadata.openGraphType) meta(property="og:type", metadata.openGraphType)
-else -else
meta(name="og:type", content="website") meta(property="og:type", content="website")
//- Viewport //- Viewport
if metadata && metadata.viewport if metadata && metadata.viewport