-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathhead.html
26 lines (23 loc) · 1.18 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
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<script src="/blog/scripts/fallback.js" nomodule></script>
<script>
const libs = (() => {
const { hostname, search } = window.location;
if (!['.hlx.', '.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}.hlx.live/libs` : `https://${branch}--milo--adobecom.hlx.live/libs`;
})();
const miloStyles = document.createElement('link');
const miloUtils = document.createElement('link');
miloStyles.setAttribute('as', 'style');
miloStyles.setAttribute('href', `${libs}/styles/styles.css`);
miloUtils.setAttribute('as', 'script');
miloUtils.setAttribute('crossorigin', 'true');
miloUtils.setAttribute('href', `${libs}/utils/utils.js`);
[miloStyles, miloUtils].forEach((tag) => tag.setAttribute('rel', 'preload'));
document.head.append(miloStyles, miloUtils);
</script>
<script src="/blog/scripts/scripts.js" type="module"></script>
<style>body { display: none; }</style>
<link rel="icon" href="data:,">