aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2024-01-22 15:15:18 +0000
committerAndrew Lee <alee14498@protonmail.com>2024-01-22 15:15:18 +0000
commit4b953d0c3be1d3c162f49612f21f5907ce64ce07 (patch)
tree9ded6195e88763c8cfe799020616113c39a48652
parent2604cab500fa359cbeb106873f6e0ea19b798e2b (diff)
downloadpersonal-website-4b953d0c3be1d3c162f49612f21f5907ce64ce07.tar.gz
personal-website-4b953d0c3be1d3c162f49612f21f5907ce64ce07.tar.bz2
personal-website-4b953d0c3be1d3c162f49612f21f5907ce64ce07.zip
Update navigation links and description is no longer hardcoded
-rw-r--r--src/components/Navbar.astro10
-rw-r--r--src/layouts/Default.astro5
-rw-r--r--src/layouts/Page.astro7
-rw-r--r--src/pages/index.astro2
-rw-r--r--src/pages/projects.astro3
5 files changed, 14 insertions, 13 deletions
diff --git a/src/components/Navbar.astro b/src/components/Navbar.astro
index 03bc27c..bd372e5 100644
--- a/src/components/Navbar.astro
+++ b/src/components/Navbar.astro
@@ -7,11 +7,11 @@ import "../styles/Navbar.css"
</button>
<ul class="nav-list">
<li><a href="/" class="nav-link">Home</a></li>
- <li><a href="#" class="nav-link">Projects</a></li>
- <li><a href="#" class="nav-link">Downloads</a></li>
- <li><a href="#" class="nav-link">Blog</a></li>
- <li><a href="#" class="nav-link">Guestbook</a></li>
- <li><a href="#" class="nav-link">Contacts</a></li>
+ <li><a href="/projects" class="nav-link">Projects</a></li>
+ <li><a href="/downloads" class="nav-link">Downloads</a></li>
+ <li><a href="/blog" class="nav-link">Blog</a></li>
+ <li><a href="/guestbook" class="nav-link">Guestbook</a></li>
+ <li><a href="/contacts" class="nav-link">Contacts</a></li>
</ul>
</nav>
diff --git a/src/layouts/Default.astro b/src/layouts/Default.astro
index e28d85c..08ed4fb 100644
--- a/src/layouts/Default.astro
+++ b/src/layouts/Default.astro
@@ -1,9 +1,10 @@
---
interface Props {
title: string;
+ description: string;
}
-const { title } = Astro.props;
+const { title, description } = Astro.props;
import { ViewTransitions } from 'astro:transitions';
import Navbar from '../components/Navbar.astro';
---
@@ -12,7 +13,7 @@ import Navbar from '../components/Navbar.astro';
<html lang="en">
<head>
<meta charset="UTF-8" />
- <meta name="description" content="Andrew Lee Website" />
+ <meta name="description" content={description} />
<meta name="viewport" content="width=device-width" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
diff --git a/src/layouts/Page.astro b/src/layouts/Page.astro
index d2624c5..b0f202a 100644
--- a/src/layouts/Page.astro
+++ b/src/layouts/Page.astro
@@ -1,11 +1,12 @@
---
import Layout from './Default.astro';
+const { title, description } = Astro.props;
---
-<Layout>
+<Layout title=`${title} | Andrew Lee` description={description}>
<header>
- <h1>Test</h1>
- <h2>Description</h2>
+ <h1>{title}</h1>
+ <h2>{description}</h2>
</header>
</Layout>
diff --git a/src/pages/index.astro b/src/pages/index.astro
index 1f6061d..ab4f39b 100644
--- a/src/pages/index.astro
+++ b/src/pages/index.astro
@@ -6,7 +6,7 @@ import Profile from '../images/Alee.png';
import '../styles/index.css';
---
-<Layout title="Andrew Lee">
+<Layout title="Andrew Lee" description="Andrew Lee Website">
<main class="home">
<div class="headline">
<Image src={Profile} class="avatar" alt="Andrew Lee" height={200} width={200} />
diff --git a/src/pages/projects.astro b/src/pages/projects.astro
index 0313de2..fb61caf 100644
--- a/src/pages/projects.astro
+++ b/src/pages/projects.astro
@@ -1,6 +1,5 @@
---
import Page from "../layouts/Page.astro";
---
-<Page>
-
+<Page title="Projects" description="Hello world">
</Page>