mirror of
https://github.com/tabler/tabler.git
synced 2026-10-12 05:06:55 +04:00
34 lines
928 B
Plaintext
34 lines
928 B
Plaintext
---
|
|
import { isExternal } from '@shared/lib/url'
|
|
// 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 target = isExternal(url) ? 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 is:inline define:vars={{ target }}>
|
|
location = target
|
|
</script>
|
|
<!-- END REDIRECT -->
|
|
|
|
|
|
</html>
|