Playing around with options for base structure and navigation

This commit is contained in:
2025-07-03 23:50:20 -07:00
parent 65e05066ea
commit d515e581b5
26 changed files with 1075 additions and 398 deletions

6
src/pages/contact.astro Normal file
View File

@@ -0,0 +1,6 @@
---
import BaseLayout from '../layouts/BaseLayout.astro';
---
<BaseLayout>
</BaseLayout>

View File

@@ -1,18 +0,0 @@
---
import {getCollection, render} from 'astro:content';
import BaseLayout from "../../layouts/BaseLayout.astro";
// 1. Generate a new path for every collection entry
export async function getStaticPaths() {
const experiences = await getCollection('experiences');
return experiences.map(experience => ({
params: {id: experience.id},
props: {experience: experience},
}));
}
// 2. For your template, you can get the entry directly from the prop
const {experience} = Astro.props;
const {Content} = await render(experience);
---
<BaseLayout title={experience.id}>
<Content/>
</BaseLayout>

View File

@@ -0,0 +1,6 @@
---
import BaseLayout from '../../layouts/BaseLayout.astro';
---
<BaseLayout>
</BaseLayout>

View File

@@ -0,0 +1,6 @@
---
import BaseLayout from '../../layouts/BaseLayout.astro';
---
<BaseLayout>
</BaseLayout>

View File

@@ -1,18 +0,0 @@
---
import {getCollection, render} from 'astro:content';
import BaseLayout from "../../layouts/BaseLayout.astro";
// 1. Generate a new path for every collection entry
export async function getStaticPaths() {
const hobbies = await getCollection('hobbies');
return hobbies.map(hobby => ({
params: {id: hobby.id},
props: {hobby: hobby, title: hobby.id},
}));
}
// 2. For your template, you can get the entry directly from the prop
const {hobby} = Astro.props;
const {Content} = await render(hobby);
---
<BaseLayout title={hobby.id}>
<Content/>
</BaseLayout>

View File

@@ -0,0 +1,6 @@
---
import BaseLayout from '../../layouts/BaseLayout.astro';
---
<BaseLayout>
</BaseLayout>

View File

@@ -1,59 +1,9 @@
---
import {getCollection} from 'astro:content';
import BaseLayout from "../layouts/BaseLayout.astro";
import BaseLayout from '../layouts/BaseLayout.astro';
import {Image} from 'astro:assets';
const experiences = await getCollection('experiences');
const projects = await getCollection('projects');
const hobbies = await getCollection('hobbies');
import headshot from "../assets/headshot.png";
---
<BaseLayout>
<h1>My Experiences</h1>
<ul>
{experiences.map(experience => (
<li><a href={`/experience/${experience.id}`}>{experience.id}</a></li>
))}
</ul>
<h1>My Projects</h1>
<ul>
{projects.map(project => (
<li><a href={`/project/${project.id}`}>{project.id}</a></li>
))}
</ul>
<h1>My Hobbies</h1>
<ul>
{hobbies.map(project => (
<li><a href={`/hobby/${project.id}`}>{project.id}</a></li>
))}
</ul>
</BaseLayout>
<!--import { getCollection, render } from 'astro:content';-->
<!--import type { CollectionEntry } from 'astro:content';-->
<!--// 1. Generate a new path for every collection entry-->
<!--export async function getStaticPaths() {-->
<!-- const project = await getCollection('project');-->
<!-- console.log(project)-->
<!-- return project.map(post => ({-->
<!-- params: { slug: post.slug }, props: { post },-->
<!-- }));-->
<!--}-->
<!--// 2. For your template, you can get the entry directly from the prop-->
<!--const { post } = Astro.props;-->
<!--const { Content } = await render(post);-->
<!--// const { Content } = await entry.render();-->
<!-- -&#45;&#45;-->
<!--<BaseLayout pageTitle="">-->
<!--&lt;!&ndash; <Baseout pageTitle={entry.data.title}>&ndash;&gt;-->
<!--&lt;!&ndash; <h1 class="text-2xl font-bold pt-10">{entry.data.title}</h1>&ndash;&gt;-->
<!--&lt;!&ndash; <p class="text-sm py-2">{entry.data.date}</p>&ndash;&gt;-->
<!--&lt;!&ndash; <h2 class="font-bold py-2">Tags</h2>&ndash;&gt;-->
<!--&lt;!&ndash; &lt;!&ndash;<ul class="list-disc list-inside py-2">&ndash;&gt;&ndash;&gt;-->
<!--&lt;!&ndash; &lt;!&ndash; {entry.data.tags?.map((tag) => <li><a href={`/tags/${tag}`}>{tag}</a></li>)}&ndash;&gt;&ndash;&gt;-->
<!--&lt;!&ndash; &lt;!&ndash;</ul>&ndash;&gt;&ndash;&gt;-->
<!--&lt;!&ndash; <div class="prose">&ndash;&gt;-->
<!--&lt;!&ndash; &lt;!&ndash;<Content />&ndash;&gt;&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<Image class="mx-auto block" src={headshot} alt="headshot" loading="eager"/>
</BaseLayout>

View File

@@ -1,18 +0,0 @@
---
import {getCollection, render} from 'astro:content';
import BaseLayout from "../../layouts/BaseLayout.astro";
// 1. Generate a new path for every collection entry
export async function getStaticPaths() {
const projects = await getCollection('projects');
return projects.map(project => ({
params: {id: project.id},
props: {project: project},
}));
}
// 2. For your template, you can get the entry directly from the prop
const {project} = Astro.props;
const {Content} = await render(project);
---
<BaseLayout title={project.id}>
<Content/>
</BaseLayout>

View File

@@ -0,0 +1,6 @@
---
import BaseLayout from '../../layouts/BaseLayout.astro';
---
<BaseLayout>
</BaseLayout>

6
src/pages/resume.astro Normal file
View File

@@ -0,0 +1,6 @@
---
import BaseLayout from '../layouts/BaseLayout.astro';
---
<BaseLayout>
</BaseLayout>