// Links that leave the site open in a new tab, so the reader never loses the // page: WhatsApp, LinkedIn, the photo credits. Everything else stays put — // in-page anchors (#contacto) obviously, and mailto: too, which hands off to // the mail client and would only leave an empty tab behind. // // `rel="noopener noreferrer"`: without noopener the opened page gets a handle // on this one through window.opener. export function esExterno(href: string): boolean { return /^https?:\/\//i.test(href); } export function propsEnlace(href: string) { return esExterno(href) ? ({ target: '_blank', rel: 'noopener noreferrer' } as const) : {}; } // Screen-reader users get told before the context switch happens (WCAG G201); // sighted readers see the new tab open. export const AVISO_PESTANA = 'se abre en otra pestaña';