Added email handling in contact

This commit is contained in:
a-ill 2023-07-30 13:33:21 +03:00
parent 5512f33b7a
commit 0b3dce7e02
2 changed files with 11 additions and 2 deletions

View File

@ -55,6 +55,15 @@
return location.map(x => locale=="en" ? x : translate($content,x)).join(", ")
}
function createMailToLink(link) {
if (link.includes("@")) {
return "mailto:" + link
}
else {
return link
}
}
onMount(() => {
})
@ -86,7 +95,7 @@
<p><b>{$content.name}: </b>{entry.name}</p>
<p><b>{$content.location}: </b>{getAddress(entry)}</p>
<p><b>{$content.website}: </b><a href={entry.website} target=;_blank; rel=noreferrer>{entry.website}</a></p>
<p><b>{$content.contact}: </b><a href={entry.contact} target=;_blank; rel=noreferrer>{entry.contact}</a></p>
<p><b>{$content.contact}: </b><a href={createMailToLink(entry.contact)} target=;_blank; rel=noreferrer>{entry.contact}</a></p>
</div>
</div>
<p><b>{$content.description}: </b>{entry.description}</p>

File diff suppressed because one or more lines are too long