layout.pug 4.8 KB

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