diff options
| -rw-r--r-- | src/layouts/Layout.astro | 28 | ||||
| -rw-r--r-- | src/pages/history/[date].astro | 17 | ||||
| -rw-r--r-- | src/pages/index.astro | 20 |
3 files changed, 36 insertions, 29 deletions
diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro new file mode 100644 index 0000000..e983a6d --- /dev/null +++ b/src/layouts/Layout.astro @@ -0,0 +1,28 @@ +--- +export interface Props { + title?: string; + description?: string; +} + +const { title = "geshem.space", description = "geshem.space - Israel Rain Radar" } = Astro.props; +--- + +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> + <meta name="apple-mobile-web-app-title" content="Geshem"> + <meta name="apple-mobile-web-app-capable" content="yes"> + <meta name="theme-color" content="#000000"> + <link rel="shortcut icon" href="/favicon.ico"> + <link rel="apple-touch-icon" href="/apple-touch-icon.png"> + <link rel="manifest" href="/manifest.json"> + <title>{title}</title> + <meta name="description" content={description}> + <script src="https://cdn.usefathom.com/script.js" data-site="MBXPLVRM" defer></script> + </head> + <body> + <slot /> + </body> +</html>
\ No newline at end of file diff --git a/src/pages/history/[date].astro b/src/pages/history/[date].astro index 8796c14..0a78f9f 100644 --- a/src/pages/history/[date].astro +++ b/src/pages/history/[date].astro @@ -1,4 +1,5 @@ --- +import Layout from '../../layouts/Layout.astro'; import { Geshem } from '../../components/Geshem'; import '../../styles/global.css'; @@ -7,16 +8,6 @@ export const prerender = false; const { date } = Astro.params; --- -<html lang="en"> - <head> - <meta charset="utf-8" /> - <link rel="icon" type="image/png" href="/favicon.png" /> - <meta name="viewport" content="width=device-width" /> - <meta name="generator" content={Astro.generator} /> - <title>Geshem - Rain Radar History</title> - <meta name="description" content="Israel Rain Radar History" /> - </head> - <body> - <Geshem client:load date={date} /> - </body> -</html>
\ No newline at end of file +<Layout title="Geshem - Rain Radar History" description="Israel Rain Radar History"> + <Geshem client:load date={date} /> +</Layout>
\ No newline at end of file diff --git a/src/pages/index.astro b/src/pages/index.astro index 96dfa0c..5b08f18 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,23 +1,11 @@ --- +import Layout from "../layouts/Layout.astro"; import { Geshem } from "../components/Geshem"; import "../styles/global.css"; const { date } = Astro.params; --- -<html lang="en"> - <head> - <meta charset="utf-8" /> - <link rel="icon" type="image/png" href="/favicon.png" /> - <meta name="viewport" content="width=device-width" /> - <title>Geshem - Rain Radar</title> - <meta name="description" content="Israel Rain Radar" /> - <script - src="https://cdn.usefathom.com/script.js" - data-site="MBXPLVRM" - defer></script> - </head> - <body> - <Geshem client:load date={date} /> - </body> -</html> +<Layout> + <Geshem client:load date={date} /> +</Layout> |
