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