mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #1007 from sharelatex/jel-social-image
Add default Twitter and OG images
This commit is contained in:
commit
6c5cf571da
1 changed files with 14 additions and 0 deletions
|
@ -51,8 +51,15 @@ meta(name="twitter:card", content=metadata.twitterCardType ? metadata.twitterCar
|
||||||
-if (metadata && metadata.twitterDescription)
|
-if (metadata && metadata.twitterDescription)
|
||||||
meta(itemprop="twitter:description", content=metadata.twitterDescription)
|
meta(itemprop="twitter:description", content=metadata.twitterDescription)
|
||||||
-if (metadata && metadata.twitterImage)
|
-if (metadata && metadata.twitterImage)
|
||||||
|
//- from the CMS
|
||||||
meta(itemprop="image", name="twitter:image", content=metadata.twitterImage.fields.file.url)
|
meta(itemprop="image", name="twitter:image", content=metadata.twitterImage.fields.file.url)
|
||||||
meta(itemprop="image", name="twitter:image:alt", content=metadata.twitterImage.fields.title)
|
meta(itemprop="image", name="twitter:image:alt", content=metadata.twitterImage.fields.title)
|
||||||
|
-else if (settings.overleaf)
|
||||||
|
//- the default image for Overleaf
|
||||||
|
meta(itemprop="image", name="twitter:image", content=buildImgPath('ol-brand/overleaf_og_logo.png'))
|
||||||
|
-else
|
||||||
|
//- the default image for ShareLaTeX
|
||||||
|
meta(itemprop="image", name="twitter:image", content='/touch-icon-192x192.png')
|
||||||
|
|
||||||
//- Open Graph
|
//- Open Graph
|
||||||
//- to do - add og:url
|
//- to do - add og:url
|
||||||
|
@ -61,7 +68,14 @@ meta(name="twitter:card", content=metadata.twitterCardType ? metadata.twitterCar
|
||||||
-if (metadata && metadata.openGraphDescription)
|
-if (metadata && metadata.openGraphDescription)
|
||||||
meta(itemprop="description", name="og:description", content=metadata.openGraphDescription)
|
meta(itemprop="description", name="og:description", content=metadata.openGraphDescription)
|
||||||
-if (metadata && metadata.openGraphImage)
|
-if (metadata && metadata.openGraphImage)
|
||||||
|
//- from the CMS
|
||||||
meta(itemprop="image", name="og:image", content=metadata.openGraphImage.fields.file.url)
|
meta(itemprop="image", name="og:image", content=metadata.openGraphImage.fields.file.url)
|
||||||
|
-else if (settings.overleaf)
|
||||||
|
//- the default image for Overleaf
|
||||||
|
meta(itemprop="image", name="og:image", content=buildImgPath('ol-brand/overleaf_og_logo.png'))
|
||||||
|
-else
|
||||||
|
//- the default image for ShareLaTeX
|
||||||
|
meta(itemprop="image", name="og:image", content='/touch-icon-192x192.png')
|
||||||
-if (metadata && metadata.openGraphType)
|
-if (metadata && metadata.openGraphType)
|
||||||
meta(name="og:type", metadata.openGraphType)
|
meta(name="og:type", metadata.openGraphType)
|
||||||
-else
|
-else
|
||||||
|
|
Loading…
Reference in a new issue