Update layout

- Move navbar into layout
- Add layout to 404 page
This commit is contained in:
Alexander Navarro 2023-08-13 12:35:44 -04:00
parent 11473a6b53
commit 6917b0c1bd
3 changed files with 25 additions and 20 deletions

View file

@ -5,6 +5,15 @@ export interface Props {
const { title } = Astro.props;
import "../assets/style/global.css";
import Navbar from '../components/Navbar.astro';
const navbarLinks = [
{ href: "/", text: "Home" },
{ href: "/blog", text: "Blog" },
{ href: "/portafolio", text: "Portafolio" },
{ href: "/curriculum", text: "Curriculum" },
{ href: "/contact", text: "Contact" },
]
---
<!DOCTYPE html>
@ -22,8 +31,17 @@ import "../assets/style/global.css";
</head>
<body>
<header>
<Navbar links={navbarLinks}/>
</header>
<main>
<slot />
</main>
</body>
</html>
<style>
header > :global(*) {
margin-left: auto;
}
</style>

View file

@ -1 +1,7 @@
<h1>not found</h1>
---
import Layout from '../layouts/Layout.astro';
---
<Layout title="Welcome to Astro.">
<h1>not found</h1>
</Layout>

View file

@ -1,23 +1,9 @@
---
import Layout from '../layouts/Layout.astro';
import Card from '../components/Card.astro';
import Navbar from '../components/Navbar.astro';
const navbarLinks = [
{ href: "/", text: "Home" },
{ href: "/blog", text: "Blog" },
{ href: "/portafolio", text: "Portafolio" },
{ href: "/curriculum", text: "Curriculum" },
{ href: "/contact", text: "Contact" },
]
---
<Layout title="Welcome to Astro.">
<header>
<Navbar links={navbarLinks}/>
</header>
<h1>Welcome to <span class="text-gradient">My Page :D</span></h1>
<p class="instructions">
@ -26,8 +12,3 @@ const navbarLinks = [
</p>
</Layout>
<style>
header > :global(*) {
margin-left: auto;
}
</style>