2018-06-19 13:57:55 -04:00
|
|
|
|
|
|
|
//- Title
|
2021-03-24 06:09:43 -04:00
|
|
|
if (metadata && metadata.title)
|
2018-06-19 13:57:55 -04:00
|
|
|
title= metadata.title + ' - ' + settings.appName + ', ' + translate("online_latex_editor")
|
|
|
|
meta(name="twitter:title", content=metadata.title)
|
|
|
|
meta(name="og:title", content=metadata.title)
|
2021-03-24 06:09:43 -04:00
|
|
|
else if (typeof(title) == "undefined")
|
2018-06-19 13:57:55 -04:00
|
|
|
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"))
|
2021-03-24 06:09:43 -04:00
|
|
|
else
|
2018-06-19 13:57:55 -04:00
|
|
|
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
|
2021-03-24 06:09:43 -04:00
|
|
|
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
|
2021-03-24 06:09:43 -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
|
2021-03-24 06:09:43 -04:00
|
|
|
if (metadata && metadata.image && metadata.image.fields)
|
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)
|
2021-03-24 06:09:43 -04:00
|
|
|
else if (metadata && metadata.image_src)
|
2018-10-04 06:24:01 -04:00
|
|
|
//- 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)
|
2021-03-24 06:09:43 -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'))
|
2021-03-24 06:09:43 -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
|
2021-03-24 06:09:43 -04:00
|
|
|
if (metadata && metadata.keywords)
|
2018-06-19 13:57:55 -04:00
|
|
|
meta(name="keywords" content=metadata.keywords)
|
|
|
|
|
|
|
|
//- Misc
|
|
|
|
meta(itemprop="name", content=settings.appName + ", the Online LaTeX Editor")
|
|
|
|
|
2021-03-24 06:09:43 -04:00
|
|
|
if (metadata && metadata.robotsNoindexNofollow)
|
2018-11-09 18:30:16 -05:00
|
|
|
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')
|
2021-03-24 06:09:43 -04:00
|
|
|
if (settings.social && settings.social.twitter && settings.social.twitter.handle)
|
2018-06-19 13:57:55 -04:00
|
|
|
meta(name="twitter:site", content="@" + settings.social.twitter.handle)
|
2021-03-24 06:09:43 -04:00
|
|
|
if (metadata && metadata.twitterDescription)
|
2018-12-05 12:41:47 -05:00
|
|
|
meta(name="twitter:description", content=metadata.twitterDescription)
|
2021-03-24 06:09:43 -04:00
|
|
|
else
|
2018-12-05 12:41:47 -05:00
|
|
|
meta(name="twitter:description", content=translate("site_description"))
|
2021-03-24 06:09:43 -04:00
|
|
|
if (metadata && metadata.twitterImage && metadata.twitterImage.fields)
|
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)
|
2021-03-24 06:09:43 -04:00
|
|
|
else if (settings.overleaf)
|
2018-10-08 10:01:18 -04:00
|
|
|
//- 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'))
|
2021-03-24 06:09:43 -04:00
|
|
|
else
|
2018-10-08 10:01:18 -04:00
|
|
|
//- 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
|
2021-03-24 06:09:43 -04:00
|
|
|
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)
|
2020-05-06 10:58:01 -04:00
|
|
|
|
2021-03-24 06:09:43 -04:00
|
|
|
if (metadata && metadata.openGraphDescription)
|
2019-02-12 10:27:34 -05:00
|
|
|
meta(property="og:description", content=metadata.openGraphDescription)
|
2021-03-24 06:09:43 -04:00
|
|
|
else
|
2019-02-12 10:27:34 -05:00
|
|
|
meta(property="og:description", content=translate("site_description"))
|
2020-05-06 10:58:01 -04:00
|
|
|
|
2021-03-24 06:09:43 -04:00
|
|
|
if (metadata && metadata.openGraphImage && metadata.openGraphImage.fields)
|
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)
|
2021-03-24 06:09:43 -04:00
|
|
|
else if (settings.overleaf)
|
2018-10-08 10:01:18 -04:00
|
|
|
//- 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'))
|
2021-03-24 06:09:43 -04:00
|
|
|
else
|
2018-10-08 10:01:18 -04:00
|
|
|
//- the default image for ShareLaTeX
|
2019-02-12 10:27:34 -05:00
|
|
|
meta(property="og:image", content='/touch-icon-192x192.png')
|
2020-05-06 10:58:01 -04:00
|
|
|
|
2021-03-24 06:09:43 -04:00
|
|
|
if (metadata && metadata.openGraphType)
|
2019-02-12 10:27:34 -05:00
|
|
|
meta(property="og:type", metadata.openGraphType)
|
2021-03-24 06:09:43 -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
|
|
|
|
2021-03-24 06:09:43 -04:00
|
|
|
if (metadata && metadata.openGraphVideo)
|
2020-05-06 10:58:01 -04:00
|
|
|
//- from the CMS
|
|
|
|
meta(property="og:video", content=metadata.openGraphVideo)
|
|
|
|
|
2018-09-27 18:27:15 -04:00
|
|
|
//- Viewport
|
2022-01-19 06:56:26 -05:00
|
|
|
if !metadata || metadata.viewport !== false
|
2018-12-05 12:41:47 -05:00
|
|
|
meta(name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes")
|
2019-03-25 11:39:06 -04:00
|
|
|
|
2019-10-15 09:10:35 -04:00
|
|
|
//- Noindex
|
|
|
|
if settings.robotsNoindex
|
|
|
|
meta(name="robots" content="noindex")
|
|
|
|
|
2022-04-12 06:25:10 -04:00
|
|
|
//- Apple devices
|
|
|
|
meta(name="apple-mobile-web-app-capable" content="yes")
|
|
|
|
meta(name="apple-mobile-web-app-status-bar-style" content="black-translucent")
|
2019-10-15 09:10:35 -04:00
|
|
|
|
2019-03-25 11:39:06 -04:00
|
|
|
//- Icons
|
2021-01-05 05:56:27 -05:00
|
|
|
link(rel="icon", href="/favicon.ico")
|
|
|
|
link(rel="icon", sizes="192x192", href="/touch-icon-192x192.png")
|
|
|
|
link(rel="apple-touch-icon-precomposed", href="/apple-touch-icon-precomposed.png")
|
|
|
|
link(rel="mask-icon", href="/mask-favicon.svg", color="#138A07")
|
2021-10-28 04:34:50 -04:00
|
|
|
|
|
|
|
//- Canonical Tag for SEO
|
|
|
|
if (metadata && metadata.canonicalURL)
|
|
|
|
link(rel="canonical" href=metadata.canonicalURL)
|