mirror of
https://github.com/placeAtlas/atlas.git
synced 2025-01-01 03:44:44 +01:00
Add domain on website links
This commit is contained in:
parent
252d39390f
commit
5b107599b4
1 changed files with 6 additions and 1 deletions
|
@ -119,7 +119,12 @@ function createInfoBlock(entry) {
|
|||
websiteLinkElement.target = "_blank";
|
||||
websiteLinkElement.rel = "noopener noreferrer";
|
||||
websiteLinkElement.href = link;
|
||||
websiteLinkElement.innerHTML = `<i class="bi bi-globe" aria-hidden="true"></i> Website`;
|
||||
try {
|
||||
const urlObject = new URL(link)
|
||||
websiteLinkElement.innerHTML = `<i class="bi bi-globe" aria-hidden="true"></i> ${urlObject.hostname}`
|
||||
} catch (e) {
|
||||
websiteLinkElement.innerHTML = `<i class="bi bi-globe" aria-hidden="true"></i> Website`;
|
||||
}
|
||||
websiteGroupElement.appendChild(websiteLinkElement);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue