changing files to baseLayout

This commit is contained in:
Manuel Ernesto Garcia 2022-09-26 15:49:05 -04:00
parent 9cb339941c
commit ebefc34e23
11 changed files with 47 additions and 35 deletions

View file

@ -1,2 +1,34 @@
# astro-personal-website
Personal Website template with blog and themes made with Astro
## Project Strucutre
``` php
├── src/
│ ├── components/
│ │ ├── cs/
│ │ │ ├── TimeLine
│ │ ├── BaseHead.astro
│ │ ├── Card.astro
│ │ ├── Footer.astro
│ │ ├── Header.astro
│ │ └-─ HorizontalCard.jsx
│ │ └-─ SideBar.jsx
│ ├── layouts/
│ │ └-─ BaseLayout.astro
│ │ └-─ PostLayout.astro
│ └── pages/
│ │ ├── posts/
│ │ │ ├── post1.md
│ │ │ ├── post2.md
│ │ │ └── post3.md
│ │ └── index.astro
│ └── styles/
│ └-─ global.css
├── public/
│ ├── favicon.svg
│ └-─ social-image.png
├── astro.config.mjs
├── package.json
└── tsconfig.json
```

View file

@ -1,20 +0,0 @@
---
export interface Props extends astroHTML.JSX.AnchorHTMLAttributes {}
const { href, class: className, ...props } = Astro.props;
const isActive = href === Astro.url.pathname.replace(/\/$/, '');
---
<a href={href} class:list={[className, { active: isActive }]} {...props}>
<slot />
</a>
<style>
a {
display: inline-block;
text-decoration: none;
}
a.active {
font-weight: bolder;
text-decoration: underline;
}
</style>

View file

@ -1,6 +1,6 @@
---
import BaseHead from "../components/BaseHead.astro";
import PageLayout from "./Base.astro";
import BaseLayout from "./BaseLayout.astro";
export interface Props {
content: {
@ -17,7 +17,7 @@ const {
} = Astro.props;
---
<PageLayout title={title} description={description} image={heroImage}>
<BaseLayout title={title} description={description} image={heroImage}>
<main class="flex justify-center">
<article class="prose prose-lg max-w-[750px] prose-img:mx-auto">
{heroImage && <img src={heroImage} alt={title} class="w-full mb-6" />}
@ -35,4 +35,4 @@ const {
<slot />
</article>
</main>
</PageLayout>
</BaseLayout>

View file

@ -1,5 +1,5 @@
---
import PageLayout from "../../layouts/Base.astro";
import BaseLayout from "../../layouts/BaseLayout.astro";
import HorizontalCard from "../../components/HorizontalCard.astro";
export async function getStaticPaths({ paginate }) {
@ -12,7 +12,7 @@ export async function getStaticPaths({ paginate }) {
const { page } = Astro.props;
---
<PageLayout>
<BaseLayout>
<ul>
<!--List the array of astronaut info-->
{page.data.map(( post ) => (
@ -34,4 +34,4 @@ const { page } = Astro.props;
{page.url.next ? <a href={page.url.next} class="btn btn-ghost my-10 mx-5">Older Posts <svg class="h-6 w-6 fill-current md:h-8 md:w-8" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"> <path d="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"></path></svg></a> : <div></div>}
</div>
</PageLayout>
</BaseLayout>

View file

@ -1,9 +1,9 @@
---
import PageLayout from "../layouts/Base.astro";
import BaseLayout from "../layouts/BaseLayout.astro";
import TimeLineElement from "../components/cv/TimeLine.astro";
---
<PageLayout>
<BaseLayout>
<div class="mb-5">
<div class="text-3xl w-full font-bold">Profile</div>
</div>
@ -118,4 +118,4 @@ import TimeLineElement from "../components/cv/TimeLine.astro";
<li>Adobe Photoshop</li>
<li>KdenLive</li>
</ul>
</PageLayout>
</BaseLayout>

View file

@ -1,5 +1,5 @@
---
import PageLayout from "../layouts/Base.astro";
import BaseLayout from "../layouts/BaseLayout.astro";
import HorizontalCard from "../components/HorizontalCard.astro";
const posts = (await Astro.glob("./blog/*.{md,mdx}")).sort(
@ -9,7 +9,7 @@ const posts = (await Astro.glob("./blog/*.{md,mdx}")).sort(
const last_posts = posts.slice(0, 3);
---
<PageLayout>
<BaseLayout>
<div class="pb-12 mt-5">
<div class="text-xl py-1">Hey there 👋</div>
@ -71,4 +71,4 @@ const last_posts = posts.slice(0, 3);
))
}
</PageLayout>
</BaseLayout>

View file

@ -1,9 +1,9 @@
---
import PageLayout from "../layouts/Base.astro";
import BaseLayout from "../layouts/BaseLayout.astro";
import HorizontalCard from "../components/HorizontalCard.astro";
---
<PageLayout>
<BaseLayout>
<div>
<div class="text-3xl w-full font-bold mb-5">Applications</div>
</div>
@ -62,4 +62,4 @@ import HorizontalCard from "../components/HorizontalCard.astro";
url="https://github.com/manuelernestog/joplin-minimalist-light-theme"
badge="FOSS"
/>
</PageLayout>
</BaseLayout>