-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Test to see if URL to main portal works"
- Loading branch information
1 parent
cf1b06b
commit 6a9d956
Showing
1 changed file
with
15 additions
and
22 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,24 +1,17 @@ | ||
{#- | ||
This file was automatically generated - do not edit | ||
-#} | ||
|
||
This file was automatically generated - do not edit | ||
-#} | ||
{% extends "base.html" %} | ||
{% block extrahead %} | ||
<script> | ||
if (window.location.hostname === 'amadeus4dev.github.io') { | ||
console.log(window.location.hostname); | ||
const path = window.location.pathname; | ||
const redirectPattern = /^\/([^/]+)/; | ||
const redirectUrl = path.replace(redirectPattern, 'https://developers.amadeus.com/self-service/apis-docs/guides/$1'); | ||
document.write(`<meta http-equiv="refresh" content="0;url=${redirectUrl}" />`); | ||
} | ||
|
||
// Add event listener to all links starting with developers.amadeus.com | ||
document.querySelectorAll('a[href^="https://developers.amadeus.com"]').forEach(link => { | ||
link.addEventListener('click', function (e) { | ||
e.preventDefault(); // Prevent the default action (navigating to the link) | ||
window.location.href = this.href; // Manually redirect the page to the link | ||
}); | ||
}); | ||
</script> | ||
{% endblock %} | ||
{% block extrahead %} | ||
<script> | ||
if (window.location.hostname === 'amadeus4dev.github.io') { | ||
console.log(window.location.hostname); | ||
const path = window.location.pathname; | ||
const redirectPattern = /^\/([^/]+)/; | ||
const redirectUrl = path.replace(redirectPattern, 'https://developers.amadeus.com/self-service/apis-docs/guides/$1'); | ||
document.write(`<meta http-equiv="refresh" content="0;url=${redirectUrl}" /> | ||
<link rel="canonical" href="${redirectUrl}" />`); | ||
} | ||
</script> | ||
{% endblock %} |