Playing around with options for base structure and navigation
This commit is contained in:
@@ -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();-->
|
||||
<!-- ----->
|
||||
<!--<BaseLayout pageTitle="">-->
|
||||
<!--<!– <Baseout pageTitle={entry.data.title}>–>-->
|
||||
<!--<!– <h1 class="text-2xl font-bold pt-10">{entry.data.title}</h1>–>-->
|
||||
<!--<!– <p class="text-sm py-2">{entry.data.date}</p>–>-->
|
||||
<!--<!– <h2 class="font-bold py-2">Tags</h2>–>-->
|
||||
<!--<!– <!–<ul class="list-disc list-inside py-2">–>–>-->
|
||||
<!--<!– <!– {entry.data.tags?.map((tag) => <li><a href={`/tags/${tag}`}>{tag}</a></li>)}–>–>-->
|
||||
<!--<!– <!–</ul>–>–>-->
|
||||
<!--<!– <div class="prose">–>-->
|
||||
<!--<!– <!–<Content />–>–>-->
|
||||
<!--<!– </div>–>-->
|
||||
<Image class="mx-auto block" src={headshot} alt="headshot" loading="eager"/>
|
||||
</BaseLayout>
|
||||
Reference in New Issue
Block a user