From 8b2a7f0e4d4c0beb5789eefb84a457c1be1b6821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20P=C4=99dzich?= Date: Sat, 2 Sep 2023 20:50:17 +0200 Subject: [PATCH] Create a base layout for all pages to use --- src/components/Footer.astro | 24 ++++++++++++++++ src/components/Header.astro | 20 ++++++++++++++ src/layouts/BaseLayout.astro | 53 ++++++++++++++++++++++++++++++++++++ src/styles/global.css | 8 ++++++ 4 files changed, 105 insertions(+) create mode 100644 src/components/Footer.astro create mode 100644 src/components/Header.astro create mode 100644 src/layouts/BaseLayout.astro create mode 100644 src/styles/global.css diff --git a/src/components/Footer.astro b/src/components/Footer.astro new file mode 100644 index 0000000..28ed9e8 --- /dev/null +++ b/src/components/Footer.astro @@ -0,0 +1,24 @@ + + + diff --git a/src/components/Header.astro b/src/components/Header.astro new file mode 100644 index 0000000..856aaa5 --- /dev/null +++ b/src/components/Header.astro @@ -0,0 +1,20 @@ +
+ +
+ + diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro new file mode 100644 index 0000000..f9468e7 --- /dev/null +++ b/src/layouts/BaseLayout.astro @@ -0,0 +1,53 @@ +--- +import 'chota/dist/chota.min.css'; +import '../styles/global.css'; + +import Header from '../components/Header.astro'; +import Footer from '../components/Footer.astro'; + +export interface Props { + title?: string; + description?: string; + image?: string; +} + +const { + title: titleProp, + description = 'Cats of people working in the tech industry', + image +} = Astro.props; + +const title = `${titleProp ? `${titleProp} - ` : ''}Cats Of Tech`; +const imageUrl = image ? new URL(image, Astro.site) : null; +--- + + + + + + + {title} + + + + + + + + { + imageUrl && ( + <> + + + + ) + } + + +
+
+ +
+