--- const { href }: Record = Astro.props; const domain = import.meta.env.SITE; let attr: { target?: string; rel?: string } = {}; let isExternal = false; if ( !href.includes(domain) && !href.startsWith("/") && !href.startsWith("#") && !href.startsWith(".") ) { attr["target"] = "_blank"; attr["rel"] = "noopener noreferrer"; isExternal = true; } --- { isExternal ? ( ) : null }