layout.pug 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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("/" + settings.brandPrefix + "style.css", {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. - if (typeof(settings.algolia) != "undefined")
  60. script.
  61. window.sharelatex.algolia = {
  62. app_id:'#{settings.algolia.app_id}',
  63. api_key:'#{settings.algolia.read_only_api_key}',
  64. indexes:!{JSON.stringify(settings.algolia.indexes)}
  65. }
  66. - if (typeof(settings.templates) != "undefined")
  67. script.
  68. window.sharelatex.templates = {
  69. user_id : '!{settings.templates.user_id}',
  70. cdnDomain : '!{settings.templates.cdnDomain}',
  71. indexName : '!{settings.templates.indexName}'
  72. }
  73. - if (settings.overleaf && settings.overleaf.useOLFreeTrial)
  74. script.
  75. window.useV2TrialUrl = true
  76. body
  77. if(settings.recaptcha)
  78. script(src="https://www.google.com/recaptcha/api.js?render=explicit")
  79. div(
  80. id="recaptcha"
  81. class="g-recaptcha"
  82. data-sitekey=settings.recaptcha.siteKey
  83. data-size="invisible"
  84. data-badge="inline"
  85. )
  86. - if(typeof(suppressNavbar) == "undefined")
  87. include layout/navbar
  88. block content
  89. div(ng-controller="AbTestController")
  90. - if(typeof(suppressFooter) == "undefined")
  91. include layout/footer
  92. - if (typeof(lookingForScribtex) != "undefined" && lookingForScribtex)
  93. span(ng-controller="ScribtexPopupController")
  94. include scribtex-modal
  95. block requirejs
  96. script(type='text/javascript').
  97. // minimal requirejs configuration (can be extended/overridden)
  98. window.requirejs = {
  99. "paths" : {
  100. "moment": "libs/#{lib('moment')}",
  101. "fineuploader": "libs/#{lib('fineuploader')}",
  102. "main": "#{buildJsPath('main.js', {hashedPath:settings.useMinifiedJs, removeExtension:true})}",
  103. "libraries": "#{buildJsPath('libraries.js', {hashedPath:settings.useMinifiedJs, removeExtension:true})}",
  104. },
  105. "config":{
  106. "moment":{
  107. "noGlobal": true
  108. }
  109. }
  110. };
  111. script(
  112. data-main=buildJsPath('main.js', {hashedPath:false}),
  113. baseurl=fullJsPath,
  114. src=buildJsPath('libs/require.js', {hashedPath:true})
  115. )
  116. != moduleIncludes("contactModal", locals)
  117. include v1-tooltip
  118. include sentry