only update header/footer on prod domain

This commit is contained in:
Jon McClure 2023-09-19 09:01:27 +01:00
parent f681b19889
commit 0f183eb876
2 changed files with 12 additions and 8 deletions

View file

@ -23,6 +23,9 @@
let data = starterData;
onMount(async () => {
if (new URL(document.location.href).origin !== 'https://www.reuters.com') {
return;
}
try {
const response = await fetch(
'https://www.reuters.com/site-api/footer/?' +
@ -58,7 +61,6 @@
</div>
</footer>
<!-- svelte-ignore css-unused-selector -->
<style lang="scss">
footer {
margin-top: 0;
@ -67,13 +69,11 @@
max-width: 1400px;
margin: 0 auto;
}
:global {
a {
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
:global(a) {
text-decoration: none;
}
:global(a:hover) {
text-decoration: underline;
}
}
</style>

View file

@ -17,6 +17,10 @@
let isMobileMenuOpen = false;
onMount(async () => {
// Only fire on prod...
if (new URL(document.location.href).origin !== 'https://www.reuters.com') {
return;
}
try {
const response = await fetch(
'https://www.reuters.com/site-api/header/?' +