-
Notifications
You must be signed in to change notification settings - Fork 16
/
head.html
33 lines (28 loc) · 1.42 KB
/
head.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!-- Modifying this file will impact your performance -->
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<script src="/scripts/fallback.js" nomodule></script>
<script>
const libs = (() => {
const { hostname, search } = window.location;
if (!['.aem.', '.stage.', 'local'].some((i) => hostname.includes(i))) return '/libs';
const branch = new URLSearchParams(search).get('milolibs') || 'main';
if (branch === 'local') return 'http://localhost:6456/libs';
return branch.includes('--') ? `https://${branch}.aem.live/libs` : `https://${branch}--milo--adobecom.aem.live/libs`;
})();
const miloStyles = document.createElement('link');
const miloUtils = document.createElement('link');
const miloDecorate = document.createElement('link');
miloStyles.setAttribute('as', 'style');
miloStyles.setAttribute('href', `${libs}/styles/styles.css`);
[miloUtils, miloDecorate].forEach((tag) => {
tag.setAttribute('crossorigin', 'true');
tag.setAttribute('as', 'script');
})
miloUtils.setAttribute('href', `${libs}/utils/utils.js`);
miloDecorate.setAttribute('href', `${libs}/utils/decorate.js`);
[miloStyles, miloUtils, miloDecorate].forEach((tag) => tag.setAttribute('rel', 'preload'));
document.head.append(miloStyles, miloUtils, miloDecorate);
</script>
<script src="/scripts/scripts.js" type="module"></script>
<style>body { display: none; }</style>
<link rel="icon" href="data:,">