layout.pug 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. doctype html
  2. html(
  3. lang=(currentLngCode || 'en'),
  4. itemscope,
  5. itemtype='http://schema.org/Product'
  6. )
  7. - metadata = metadata || {}
  8. block vars
  9. head
  10. include ./_metadata.pug
  11. script(type="text/javascript").
  12. // Stop superfish from loading
  13. window.similarproducts = true
  14. style [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {display: none !important; display: none; }
  15. -if (typeof(gaExperiments) != "undefined")
  16. |!{gaExperiments}
  17. //- Stylesheet
  18. link(rel='stylesheet', href=buildCssPath(getCssThemeModifier(userSettings, brandVariation), { hashedPath: true }), id="main-stylesheet")
  19. block _headLinks
  20. if settings.i18n.subdomainLang
  21. each subdomainDetails in settings.i18n.subdomainLang
  22. if !subdomainDetails.hide
  23. link(rel="alternate", href=subdomainDetails.url+currentUrl, hreflang=subdomainDetails.lngCode)
  24. //- Scripts
  25. //- Google Analytics
  26. - if (typeof(gaToken) != "undefined")
  27. script(type='text/javascript').
  28. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  29. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  30. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  31. })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  32. ga('create', '#{gaToken}', '#{settings.cookieDomain.replace(/^\./, "")}');
  33. ga('send', 'pageview');
  34. - else
  35. script(type='text/javascript').
  36. window.ga = function() { console.log("would send to GA", arguments) };
  37. script(type="text/javascript").
  38. window.csrfToken = "#{csrfToken}";
  39. script(src=buildJsPath("libs/jquery-1.11.1.min.js"))
  40. script(type="text/javascript").
  41. var noCdnKey = "nocdn=true"
  42. var cdnBlocked = typeof jQuery === 'undefined'
  43. var noCdnAlreadyInUrl = window.location.href.indexOf(noCdnKey) != -1 //prevent loops
  44. if (cdnBlocked && !noCdnAlreadyInUrl && navigator.userAgent.indexOf("Googlebot") == -1) {
  45. window.location.search += '&'+noCdnKey;
  46. }
  47. block scripts
  48. script(src=buildJsPath("libs/angular-1.6.4.min.js"))
  49. script.
  50. window.sharelatex = {
  51. siteUrl: '#{settings.siteUrl}',
  52. wsUrl: '#{settings.wsUrl}',
  53. jsPath: '#{jsPath}',
  54. sixpackDomain: '#{settings.sixpack.domain}'
  55. };
  56. window.systemMessages = !{StringHelper.stringifyJsonForScript(systemMessages)};
  57. window.ab = {};
  58. window.user_id = '#{getLoggedInUserId()}';
  59. window.ExposedSettings = JSON.parse('!{StringHelper.stringifyJsonForScript(ExposedSettings)}');
  60. - if (typeof(settings.algolia) != "undefined")
  61. script.
  62. window.sharelatex.algolia = {
  63. app_id:'#{settings.algolia.app_id}',
  64. api_key:'#{settings.algolia.read_only_api_key}',
  65. indexes:!{StringHelper.stringifyJsonForScript(settings.algolia.indexes)}
  66. }
  67. - if (typeof(settings.templates) != "undefined")
  68. script.
  69. window.sharelatex.templates = {
  70. user_id : '!{settings.templates.user_id}',
  71. cdnDomain : '!{settings.templates.cdnDomain}',
  72. indexName : '!{settings.templates.indexName}'
  73. }
  74. - if (settings.overleaf && settings.overleaf.useOLFreeTrial)
  75. script.
  76. window.useV2TrialUrl = true
  77. body
  78. if(settings.recaptcha)
  79. if (settings.recaptcha.siteKeyV3)
  80. script(src="https://www.google.com/recaptcha/api.js?render="+settings.recaptcha.siteKeyV3)
  81. else
  82. script(src="https://www.google.com/recaptcha/api.js?render=explicit")
  83. div(
  84. id="recaptcha"
  85. class="g-recaptcha"
  86. data-sitekey=settings.recaptcha.siteKey
  87. data-size="invisible"
  88. data-badge="inline"
  89. )
  90. - if(typeof(suppressNavbar) == "undefined")
  91. include layout/navbar
  92. block content
  93. div(ng-controller="AbTestController")
  94. - if(typeof(suppressFooter) == "undefined")
  95. include layout/footer
  96. - if (typeof(lookingForScribtex) != "undefined" && lookingForScribtex)
  97. span(ng-controller="ScribtexPopupController")
  98. include scribtex-modal
  99. block requirejs
  100. script(type='text/javascript').
  101. // minimal requirejs configuration (can be extended/overridden)
  102. window.requirejs = {
  103. "paths" : {
  104. "moment": "libs/#{lib('moment')}",
  105. "fineuploader": "libs/#{lib('fineuploader')}",
  106. "main": "#{buildJsPath('main.js', {hashedPath:settings.useMinifiedJs, removeExtension:true})}",
  107. "libraries": "#{buildJsPath('libraries.js', {hashedPath:settings.useMinifiedJs, removeExtension:true})}",
  108. },
  109. "config":{
  110. "moment":{
  111. "noGlobal": true
  112. }
  113. }
  114. };
  115. script(
  116. data-main=buildJsPath('main.js', {hashedPath:false}),
  117. baseurl=fullJsPath,
  118. src=buildJsPath('libs/require.js', {hashedPath:true})
  119. )
  120. != moduleIncludes("contactModal", locals)
  121. include v1-tooltip
  122. include sentry