UNPKG

astro

Version:

Astro is a modern site builder with web best practices, performance, and DX front-of-mind.

20 lines (19 loc) 543 B
function redirectTemplate({ status, absoluteLocation, relativeLocation, from }) { const delay = status === 302 ? 2 : 0; return `<!doctype html> <title>Redirecting to: ${relativeLocation}</title> <meta http-equiv="refresh" content="${delay};url=${relativeLocation}"> <meta name="robots" content="noindex"> <link rel="canonical" href="${absoluteLocation}"> <body> <a href="${relativeLocation}">Redirecting ${from ? `from <code>${from}</code> ` : ""}to <code>${relativeLocation}</code></a> </body>`; } export { redirectTemplate };