layout.pug 4.8 KB

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