Skip to content

Instantly share code, notes, and snippets.

@ivoba
Created February 7, 2025 09:13
Show Gist options
  • Save ivoba/222d5a49ad4542392772195c5e5ad032 to your computer and use it in GitHub Desktop.
Save ivoba/222d5a49ad4542392772195c5e5ad032 to your computer and use it in GitHub Desktop.
Astro ObfuscateLink component
---
import ObfuscateLink from './ObfuscateLink.astro';
---
<div class="card hint">
<p>
Email: <ObfuscateLink email="[email protected]" />
</p>
</div>
---
---
<!doctype html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<meta name="language" content="de" />
<title>ObfuscateLink Astro component</title>
</head>
<body>
<slot />
<script>
import { ObfuscateLink } from 'obfuscate-link-web-component';
// Only define the custom element if it hasn't been defined yet
if (!customElements.get('obfuscate-link')) {
customElements.define('obfuscate-link', ObfuscateLink);
}
</script>
</body>
</html>
<style></style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment