layout.pug 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. doctype html
  2. html(itemscope, itemtype='http://schema.org/Product')
  3. block vars
  4. head
  5. script(type="text/javascript").
  6. // Stop superfish from loading
  7. window.similarproducts = true
  8. style [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {display: none !important; display: none; }
  9. -if (typeof(gaExperiments) != "undefined")
  10. |!{gaExperiments}
  11. //- Title
  12. -if (typeof(title) == "undefined")
  13. title= settings.appName + ', '+ translate("online_latex_editor")
  14. meta(name="twitter:title", content=settings.appName + ', '+ translate("online_latex_editor"))
  15. meta(name="og:title", content=settings.appName + ', '+ translate("online_latex_editor"))
  16. -else
  17. title= translate(title) + ' - ' + settings.appName + ', ' + translate("online_latex_editor")
  18. //- to do - not translate?
  19. meta(name="twitter:title", content=translate(title))
  20. meta(name="og:title", content=translate(title))
  21. //- Icons
  22. link(rel="icon", href="/" + settings.brandPrefix + "favicon.ico")
  23. link(rel="icon", sizes="192x192", href="/" + settings.brandPrefix + "touch-icon-192x192.png")
  24. link(rel="apple-touch-icon-precomposed", href="/" + settings.brandPrefix + "apple-touch-icon-precomposed.png")
  25. link(rel="mask-icon", href="/" + settings.brandPrefix + "mask-favicon.svg", color=settings.brandPrefix === 'ol-' ? "#4f9c45" : "#a93529")
  26. //- Stylesheet
  27. link(rel='stylesheet', href=buildCssPath("/" + settings.brandPrefix + "style.css", {hashedPath:true}))
  28. block _headLinks
  29. if settings.i18n.subdomainLang
  30. each subdomainDetails in settings.i18n.subdomainLang
  31. if !subdomainDetails.hide
  32. link(rel="alternate", href=subdomainDetails.url+currentUrl, hreflang=subdomainDetails.lngCode)
  33. meta(itemprop="name", content=settings.appName + ", the Online LaTeX Editor")
  34. //- Description
  35. -if (typeof(meta) == "undefined")
  36. meta(itemprop="description", name="description", content=translate("site_description"))
  37. -else
  38. meta(itemprop="description", name="description" , content=meta)
  39. -if (typeof(metaImage) == "undefined")
  40. meta(itemprop="image", name="image", content="/" + settings.brandPrefix + "favicon.ico")
  41. -else
  42. meta(itemprop="image", name="image", content=metaImage.fields.file.url)
  43. //- Meta Tags: Twitter
  44. -if (settings.social && settings.social.twitter && settings.social.twitter.handle)
  45. meta(name="twitter:site", content=settings.social.twitter.handle)
  46. meta(name="twitter:card", content=metaTwitterCard ? metaTwitterCard : 'summary')
  47. -if (typeof(metaTwitterDescription) != "undefined")
  48. meta(itemprop="twitter:description", content=metaTwitterDescription)
  49. -if (typeof(metaTwitterImage) != "undefined")
  50. meta(itemprop="image", name="image", content=metaTwitterImage.fields.file.url)
  51. -else if (typeof(metaImage) != "undefined")
  52. meta(itemprop="image", name="image", content=metaImage.fields.file.url)
  53. //- Meta Tags: Open Graph
  54. -if (settings.social && settings.social.facebook && settings.social.facebook.appId)
  55. meta(name="fb:app_id", content=settings.social.facebook.appId)
  56. -if (typeof(metaOpenGraphDescription) != "undefined")
  57. meta(itemprop="og:description", content=metaOpenGraphDescription)
  58. -if (typeof(metaOpenGraphImage) != "undefined")
  59. meta(itemprop="image", name="image", content=metaOpenGraphImage.fields.file.url)
  60. -else if (typeof(metaImage) != "undefined")
  61. meta(itemprop="image", name="image", content=metaImage.fields.file.url)
  62. -if (typeof(metaOgType) != "undefined")
  63. meta(name="og:type", metaOgType)
  64. -else
  65. meta(name="og:type", content="website")
  66. //- Scripts
  67. //- Google Analytics
  68. - if (typeof(gaToken) != "undefined")
  69. script(type='text/javascript').
  70. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  71. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  72. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  73. })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  74. ga('create', '#{gaToken}', '#{settings.cookieDomain.replace(/^\./, "")}');
  75. ga('send', 'pageview');
  76. - else
  77. script(type='text/javascript').
  78. window.ga = function() { console.log("would send to GA", arguments) };
  79. script(type="text/javascript").
  80. window.csrfToken = "#{csrfToken}";
  81. script(src=buildJsPath("libs/jquery-1.11.1.min.js"))
  82. script(type="text/javascript").
  83. var noCdnKey = "nocdn=true"
  84. var cdnBlocked = typeof jQuery === 'undefined'
  85. var noCdnAlreadyInUrl = window.location.href.indexOf(noCdnKey) != -1 //prevent loops
  86. if (cdnBlocked && !noCdnAlreadyInUrl && navigator.userAgent.indexOf("Googlebot") == -1) {
  87. window.location.search += '&'+noCdnKey;
  88. }
  89. block scripts
  90. script(src=buildJsPath("libs/angular-1.6.4.min.js"))
  91. script.
  92. window.sharelatex = {
  93. siteUrl: '#{settings.siteUrl}',
  94. jsPath: '#{jsPath}',
  95. sixpackDomain: '#{settings.sixpack.domain}'
  96. };
  97. window.systemMessages = !{JSON.stringify(systemMessages).replace(/\//g, '\\/')};
  98. window.ab = {};
  99. window.user_id = '#{getLoggedInUserId()}';
  100. - if (typeof(settings.algolia) != "undefined")
  101. script.
  102. window.sharelatex.algolia = {
  103. app_id:'#{settings.algolia.app_id}',
  104. api_key:'#{settings.algolia.read_only_api_key}',
  105. indexes:!{JSON.stringify(settings.algolia.indexes)}
  106. }
  107. - if (typeof(settings.templates) != "undefined")
  108. script.
  109. window.sharelatex.templates = {
  110. user_id : '!{settings.templates.user_id}',
  111. cdnDomain : '!{settings.templates.cdnDomain}',
  112. indexName : '!{settings.templates.indexName}'
  113. }
  114. - if (settings.overleaf && settings.overleaf.useOLFreeTrial)
  115. script.
  116. window.useV2TrialUrl = true
  117. body
  118. if(settings.recaptcha)
  119. script(src="https://www.google.com/recaptcha/api.js?render=explicit")
  120. div(
  121. id="recaptcha"
  122. class="g-recaptcha"
  123. data-sitekey=settings.recaptcha.siteKey
  124. data-size="invisible"
  125. data-badge="inline"
  126. )
  127. - if(typeof(suppressNavbar) == "undefined")
  128. include layout/navbar
  129. block content
  130. div(ng-controller="AbTestController")
  131. - if(typeof(suppressFooter) == "undefined")
  132. include layout/footer
  133. - if (typeof(lookingForScribtex) != "undefined" && lookingForScribtex)
  134. span(ng-controller="ScribtexPopupController")
  135. include scribtex-modal
  136. block requirejs
  137. script(type='text/javascript').
  138. // minimal requirejs configuration (can be extended/overridden)
  139. window.requirejs = {
  140. "paths" : {
  141. "moment": "libs/#{lib('moment')}",
  142. "fineuploader": "libs/#{lib('fineuploader')}",
  143. "main": "#{buildJsPath('main.js', {hashedPath:settings.useMinifiedJs, removeExtension:true})}",
  144. "libraries": "#{buildJsPath('libraries.js', {hashedPath:settings.useMinifiedJs, removeExtension:true})}",
  145. },
  146. "config":{
  147. "moment":{
  148. "noGlobal": true
  149. }
  150. }
  151. };
  152. script(
  153. data-main=buildJsPath('main.js', {hashedPath:false}),
  154. baseurl=fullJsPath,
  155. src=buildJsPath('libs/require.js', {hashedPath:true})
  156. )
  157. != moduleIncludes("contactModal", locals)
  158. include v1-tooltip
  159. include sentry