From c97a72e1ecf1a4f0069a61c51caa14294dd1e825 Mon Sep 17 00:00:00 2001 From: Andre Rossouw Date: Thu, 21 Dec 2023 07:51:06 +0200 Subject: [PATCH] Finished with Layouts and Components And starting with the api https://docs.astro.build/en/tutorial/5-astro-api/ --- src/components/Footer.astro | 18 ++++++ src/components/Hamburger.astro | 7 +++ src/components/Header.astro | 10 ++++ src/components/Navigation.astro | 7 +++ src/components/Social.astro | 13 +++++ src/layouts/BaseLayout.astro | 25 +++++++++ src/layouts/MarkdownPostLayout.astro | 10 ++++ src/pages/about.astro | 50 +++++++++++------ src/pages/blog.astro | 31 ++++------ src/pages/index.astro | 23 ++------ src/pages/posts/post-1.md | 11 +--- src/pages/posts/post-2.md | 1 + src/pages/posts/post-3.md | 1 + src/scripts/menu.js | 3 + src/styles/global.css | 84 ++++++++++++++++++++++++++++ 15 files changed, 231 insertions(+), 63 deletions(-) create mode 100644 src/components/Footer.astro create mode 100644 src/components/Hamburger.astro create mode 100644 src/components/Header.astro create mode 100644 src/components/Navigation.astro create mode 100644 src/components/Social.astro create mode 100644 src/layouts/BaseLayout.astro create mode 100644 src/layouts/MarkdownPostLayout.astro create mode 100644 src/scripts/menu.js 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..8551294 --- /dev/null +++ b/src/components/Footer.astro @@ -0,0 +1,18 @@ +--- +const platform = "github"; +const username = "withastro"; +import Social from './Social.astro'; +--- + + + \ No newline at end of file diff --git a/src/components/Hamburger.astro b/src/components/Hamburger.astro new file mode 100644 index 0000000..aa83679 --- /dev/null +++ b/src/components/Hamburger.astro @@ -0,0 +1,7 @@ +--- +--- +
+ + + +
\ No newline at end of file diff --git a/src/components/Header.astro b/src/components/Header.astro new file mode 100644 index 0000000..7935af7 --- /dev/null +++ b/src/components/Header.astro @@ -0,0 +1,10 @@ +--- +import Hamburger from './Hamburger.astro'; +import Navigation from './Navigation.astro'; +--- +
+ +
diff --git a/src/components/Navigation.astro b/src/components/Navigation.astro new file mode 100644 index 0000000..cf6026f --- /dev/null +++ b/src/components/Navigation.astro @@ -0,0 +1,7 @@ +--- +--- + \ No newline at end of file diff --git a/src/components/Social.astro b/src/components/Social.astro new file mode 100644 index 0000000..20979f4 --- /dev/null +++ b/src/components/Social.astro @@ -0,0 +1,13 @@ +--- +const { platform, username } = Astro.props; +--- +{platform} + + \ No newline at end of file diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro new file mode 100644 index 0000000..9938436 --- /dev/null +++ b/src/layouts/BaseLayout.astro @@ -0,0 +1,25 @@ +--- +import Header from '../components/Header.astro'; +import Footer from '../components/Footer.astro'; +import '../styles/global.css'; +const { pageTitle } = Astro.props; +--- + + + + + + + + {pageTitle} + + +
+

{pageTitle}

+ +