generated from adobe/aem-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 1st vers of blog article import with basic cleanup * Added tags to meta table, removed inline metadata * Blog import * Fixing tags * Fixing metadata * Making image more stable * Trying to have image be correct in the index * Adding the CA urls * Using Image from meta if it exists * Removed page edited manually --------- Co-authored-by: Chris Bohnert <[email protected]>
- Loading branch information
1 parent
d61355f
commit 9388c20
Showing
6 changed files
with
511 additions
and
8 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
function makeProxySrcs(main, document, host = 'https://www.24petwatch.com') => { | ||
main.querySelectorAll('img').forEach((img) => { | ||
if (img.src.startsWith('//')) { | ||
img.src = `https:${img.src}`; | ||
} else if (img.src.startsWith('/')) { | ||
// make absolute | ||
const cu = new URL(host); | ||
img.src = `${cu.origin}${img.src}`; | ||
} | ||
try { | ||
const u = new URL(img.src); | ||
u.searchParams.append('host', u.origin); | ||
img.src = `http://localhost:3001${u.pathname}${u.search}`; | ||
} catch (error) { | ||
console.warn(`Unable to make proxy src for ${img.src}: ${error.message}`); | ||
} | ||
}); | ||
}; | ||
|
||
export default makeProxySrcs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters