Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ const CONFIG = {
'^https://.*--blog--.*.(hlx|aem).(page|live)': {
'blog.adobe.com': 'origin',
},
'preview.da.live': {
'blog.adobe.com': 'origin',
},
},
};

Expand Down Expand Up @@ -222,7 +225,7 @@ function decorateFeatImg(getMetadata) {

const { loadArea, setConfig, getMetadata } = await import(`${miloLibs}/utils/utils.js`);

(async function loadPage() {
async function loadPage() {
decorateFeatImg(getMetadata);
decorateTopicPage();
decorateFigure();
Expand All @@ -235,4 +238,11 @@ const { loadArea, setConfig, getMetadata } = await import(`${miloLibs}/utils/uti
overrideMiloBlocks();
await loadArea();
initSidekick();
}

loadPage();

(async function loadDa() {
if (!new URL(window.location.href).searchParams.get('dapreview')) return;
import('https://da.live/scripts/dapreview.js').then(({ default: daPreview }) => daPreview(loadPage));
}());
2 changes: 1 addition & 1 deletion scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const [setLibs, getLibs] = (() => {
(prodLibs, location) => {
libs = (() => {
const { hostname, search } = location || window.location;
if (!(hostname.includes('.aem.') || hostname.includes('.hlx.') || hostname.includes('local'))) return prodLibs;
if (!(hostname.includes('.aem.') || hostname.includes('.hlx.') || hostname.includes('.da.') || hostname.includes('local'))) return prodLibs;
const branch = new URLSearchParams(search).get('milolibs') || 'main';
if (!/^[a-zA-Z0-9_-]+$/.test(branch)) throw new Error('Invalid branch name.');
if (branch === 'local') return 'http://localhost:6456/libs';
Expand Down
Loading