layout-base.pug 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. include ./_mixins/foot_scripts
  2. doctype html
  3. html(
  4. lang=currentLngCode || 'en'
  5. class=fixedSizeDocument ? 'fixed-size-document' : undefined
  6. )
  7. - metadata = metadata || {}
  8. - let isWebsiteRedesign = false
  9. - let isApplicationPage = false
  10. - let enableIeeeBranding = true
  11. block entrypointVar
  12. block isApplicationPageVar
  13. block vars
  14. head
  15. include ./_metadata.pug
  16. //- Stylesheet
  17. link(rel='stylesheet' href=buildCssPath() id='main-stylesheet')
  18. block css
  19. each file in entrypointStyles(entrypoint)
  20. link(rel='stylesheet' href=file)
  21. block _headLinks
  22. if typeof suppressRelAlternateLinks == 'undefined'
  23. if settings.i18n.subdomainLang
  24. each subdomainDetails in settings.i18n.subdomainLang
  25. if !subdomainDetails.hide
  26. link(
  27. rel='alternate'
  28. href=subdomainDetails.url + currentUrl
  29. hreflang=subdomainDetails.lngCode
  30. )
  31. if entrypoint !== 'marketing'
  32. link(
  33. rel='preload'
  34. href=buildJsPath(currentLngCode + '-json.js')
  35. as='script'
  36. nonce=scriptNonce
  37. )
  38. //- Scripts
  39. if typeof suppressAnalytics == 'undefined'
  40. include _google_analytics
  41. block meta
  42. meta(name='ol-csrfToken' content=csrfToken)
  43. //- Configure dynamically loaded assets (via webpack) to be downloaded from CDN
  44. //- See: https://webpack.js.org/guides/public-path/#on-the-fly
  45. meta(name='ol-baseAssetPath' content=buildBaseAssetPath())
  46. meta(name='ol-mathJaxPath' content=mathJaxPath)
  47. meta(name='ol-dictionariesRoot' content=dictionariesRoot)
  48. meta(name='ol-usersEmail' content=getUserEmail())
  49. meta(name='ol-ab' data-type='json' content={})
  50. meta(name='ol-user_id' content=getLoggedInUserId())
  51. //- Internationalisation settings
  52. meta(
  53. name='ol-i18n'
  54. data-type='json'
  55. content={
  56. currentLangCode: currentLngCode,
  57. }
  58. )
  59. //- Expose some settings globally to the frontend
  60. meta(name='ol-ExposedSettings' data-type='json' content=ExposedSettings)
  61. meta(
  62. name='ol-splitTestVariants'
  63. data-type='json'
  64. content=splitTestVariants || {}
  65. )
  66. meta(name='ol-splitTestInfo' data-type='json' content=splitTestInfo || {})
  67. if typeof settings.algolia != 'undefined'
  68. meta(
  69. name='ol-algolia'
  70. data-type='json'
  71. content={
  72. appId: settings.algolia.app_id,
  73. apiKey: settings.algolia.read_only_api_key,
  74. indexes: settings.algolia.indexes,
  75. }
  76. )
  77. meta(
  78. name='ol-isManagedAccount'
  79. data-type='boolean'
  80. content=isManagedAccount
  81. )
  82. each restriction in userRestrictions || []
  83. meta(name='ol-cannot-' + restriction data-type='boolean' content)
  84. block head-scripts
  85. body(
  86. class={
  87. 'thin-footer': showThinFooter,
  88. 'website-redesign': isWebsiteRedesign === true || websiteRedesignOverride,
  89. 'application-page': isApplicationPage,
  90. }
  91. data-theme='default'
  92. )
  93. if settings.recaptcha && settings.recaptcha.siteKeyV3
  94. script(
  95. type='text/javascript'
  96. nonce=scriptNonce
  97. src='https://www.recaptcha.net/recaptcha/api.js?render=' + settings.recaptcha.siteKeyV3
  98. defer=deferScripts
  99. )
  100. if typeof suppressSkipToContent == 'undefined'
  101. a(class='skip-to-content' href='#main-content') #{translate('skip_to_content')}
  102. block body
  103. if settings.devToolbar.enabled
  104. #dev-toolbar
  105. block foot-scripts
  106. +foot-scripts
  107. include _customer_io