2018-06-19 17:57:55 +00:00
|
|
|
|
|
|
|
//- Title
|
|
|
|
-if (metadata && metadata.title)
|
|
|
|
title= metadata.title + ' - ' + settings.appName + ', ' + translate("online_latex_editor")
|
|
|
|
meta(name="twitter:title", content=metadata.title)
|
|
|
|
meta(name="og:title", content=metadata.title)
|
|
|
|
-else if (typeof(title) == "undefined")
|
|
|
|
title= settings.appName + ', '+ translate("online_latex_editor")
|
|
|
|
meta(name="twitter:title", content=settings.appName + ', '+ translate("online_latex_editor"))
|
|
|
|
meta(name="og:title", content=settings.appName + ', '+ translate("online_latex_editor"))
|
|
|
|
-else
|
|
|
|
title= translate(title) + ' - ' + settings.appName + ', ' + translate("online_latex_editor")
|
|
|
|
//- to do - not translate?
|
|
|
|
meta(name="twitter:title", content=translate(title))
|
|
|
|
meta(name="og:title", content=translate(title))
|
|
|
|
|
|
|
|
//- Description
|
|
|
|
-if (metadata && metadata.description)
|
|
|
|
meta(itemprop="description", name="description" , content=metadata.description)
|
|
|
|
//-twitter and og descriptions handeled below
|
|
|
|
-else
|
|
|
|
meta(itemprop="description", name="description", content=translate("site_description"))
|
|
|
|
meta(itemprop="description", name="twitter:description", content=translate("site_description"))
|
|
|
|
meta(itemprop="description", name="og:description", content=translate("site_description"))
|
|
|
|
|
|
|
|
//- Image
|
|
|
|
-if (metadata && metadata.image)
|
2018-10-04 10:24:01 +00:00
|
|
|
//- from the CMS
|
2018-06-19 17:57:55 +00:00
|
|
|
meta(itemprop="image", name="image", content=metadata.image.fields.file.url)
|
2018-10-04 10:24:01 +00:00
|
|
|
-else if (metadata && metadata.image_src)
|
|
|
|
//- pages with custom metadata images, metadata.image_src is the full image URL
|
|
|
|
meta(itemprop="image", name="image", content=metadata.image_src)
|
2018-10-03 15:50:42 +00:00
|
|
|
-else if (settings.overleaf)
|
2018-10-04 10:24:01 +00:00
|
|
|
//- the default image for Overleaf
|
2018-10-03 15:50:42 +00:00
|
|
|
meta(itemprop="image", name="image", content=buildImgPath('ol-brand/overleaf_og_logo.png'))
|
2018-06-19 17:57:55 +00:00
|
|
|
-else
|
2018-10-04 10:24:01 +00:00
|
|
|
//- the default image for ShareLaTeX
|
2018-10-03 15:50:42 +00:00
|
|
|
meta(itemprop="image", name="image", content='/touch-icon-192x192.png')
|
2018-06-19 17:57:55 +00:00
|
|
|
|
|
|
|
//- Keywords
|
|
|
|
-if (metadata && metadata.keywords)
|
|
|
|
meta(name="keywords" content=metadata.keywords)
|
|
|
|
|
|
|
|
//- Misc
|
|
|
|
meta(itemprop="name", content=settings.appName + ", the Online LaTeX Editor")
|
|
|
|
|
2018-11-09 23:30:16 +00:00
|
|
|
-if (metadata && metadata.robotsNoindexNofollow)
|
|
|
|
meta(name="robots" content="noindex, nofollow")
|
|
|
|
|
2018-06-19 17:57:55 +00:00
|
|
|
//- Twitter
|
2018-10-19 14:01:56 +00:00
|
|
|
meta(name="twitter:card", content=metadata && metadata.twitterCardType ? metadata.twitterCardType : 'summary')
|
2018-06-19 17:57:55 +00:00
|
|
|
-if (settings.social && settings.social.twitter && settings.social.twitter.handle)
|
|
|
|
meta(name="twitter:site", content="@" + settings.social.twitter.handle)
|
|
|
|
-if (metadata && metadata.twitterDescription)
|
|
|
|
meta(itemprop="twitter:description", content=metadata.twitterDescription)
|
|
|
|
-if (metadata && metadata.twitterImage)
|
2018-10-08 14:01:18 +00:00
|
|
|
//- from the CMS
|
2018-06-19 17:57:55 +00:00
|
|
|
meta(itemprop="image", name="twitter:image", content=metadata.twitterImage.fields.file.url)
|
|
|
|
meta(itemprop="image", name="twitter:image:alt", content=metadata.twitterImage.fields.title)
|
2018-10-08 14:01:18 +00:00
|
|
|
-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')
|
2018-06-19 17:57:55 +00:00
|
|
|
|
|
|
|
//- Open Graph
|
|
|
|
//- to do - add og:url
|
|
|
|
-if (settings.social && settings.social.facebook && settings.social.facebook.appId)
|
|
|
|
meta(name="fb:app_id", content=settings.social.facebook.appId)
|
|
|
|
-if (metadata && metadata.openGraphDescription)
|
|
|
|
meta(itemprop="description", name="og:description", content=metadata.openGraphDescription)
|
|
|
|
-if (metadata && metadata.openGraphImage)
|
2018-10-08 14:01:18 +00:00
|
|
|
//- from the CMS
|
2018-06-19 17:57:55 +00:00
|
|
|
meta(itemprop="image", name="og:image", content=metadata.openGraphImage.fields.file.url)
|
2018-10-08 14:01:18 +00:00
|
|
|
-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')
|
2018-06-19 17:57:55 +00:00
|
|
|
-if (metadata && metadata.openGraphType)
|
|
|
|
meta(name="og:type", metadata.openGraphType)
|
|
|
|
-else
|
2018-09-27 22:27:15 +00:00
|
|
|
meta(name="og:type", content="website")
|
|
|
|
|
|
|
|
//- Viewport
|
2018-10-19 14:01:56 +00:00
|
|
|
if metadata && metadata.viewport
|
2018-09-27 22:27:15 +00:00
|
|
|
meta(name="viewport" content="width=device-width; initial-scale=1.0; user-scalable=yes;")
|