1
0
mirror of https://github.com/tabler/tabler.git synced 2026-08-07 03:42:27 +04:00
Files
tabler/shared/layouts/RedirectLayout.astro

34 lines
939 B
Plaintext

---
// Bare meta-refresh redirect document.
interface Props {
/** Redirect target. Absolute http(s) URLs are used as-is; relative ones are prefixed with `base`. */
url?: string
/** Relative path to the site root from this page. Defaults to ".". */
base?: string
}
const { url = '', base = '.' } = Astro.props
const isAbsolute = url.includes('http://') || url.includes('https://')
const target = isAbsolute ? url : `${base}${url}`
---
<!doctype html>
<html lang="en-US">
<!-- BEGIN META -->
<meta charset="utf-8" />
<title>Redirecting…</title>
<link rel="canonical" href={target} />
<meta http-equiv="refresh" content={`0; url=${target}`} />
<meta name="robots" content="noindex" />
<!-- END META -->
<noscript><a href={target}>Click here if you are not redirected.</a></noscript>
<!-- BEGIN REDIRECT -->
<script define:vars={{ target }}>
location = target
</script>
<!-- END REDIRECT -->
</html>