Hack the logo to point to the marketing site (#2441)

This commit is contained in:
Alex Fornuto 2021-08-05 19:08:43 -05:00 committed by GitHub
parent 5604c58657
commit 2b200f8704
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -229,4 +229,31 @@ module.exports = {
],
},
},
head: [
//Hack: Make clicking on the logo go to home url
["script",
{},
`
const logoUrlChanger = setInterval(function() {
//Anchor above the logo image
const homeEls = document.getElementsByClassName("home-link");
if(homeEls.length > 0) {
const homeEl = homeEls[0];
homeEl.setAttribute("href", "https://www.pomerium.com");
homeEl.setAttribute("onclick", "document.location='https://www.pomerium.com';return false;");
clearInterval(logoUrlChanger);
}
//Actual logo image
const logoEls = document.getElementsByClassName("logo")
if(logoEls.length > 0) {
const logoEl = logoEls[0]
logoEl.setAttribute("onclick", "document.location='https://www.pomerium.com';return false;");
clearInterval(logoUrlChanger);
}
}, 1000)
`
]
],
};