|
@@ -1,66 +0,0 @@
|
|
|
-<script lang="ts">
|
|
|
|
|
- import { getCollection, getEntry } from "astro:content";
|
|
|
|
|
- import { onMount } from "svelte";
|
|
|
|
|
-
|
|
|
|
|
- interface ProjectsEntry {
|
|
|
|
|
- data: {
|
|
|
|
|
- title: string;
|
|
|
|
|
- demo: string;
|
|
|
|
|
- source: string;
|
|
|
|
|
- };
|
|
|
|
|
- body: string;
|
|
|
|
|
- filePath: string;
|
|
|
|
|
- digest: string;
|
|
|
|
|
- deferredRender: boolean;
|
|
|
|
|
- collection: string;
|
|
|
|
|
- slug: string;
|
|
|
|
|
- render: (render: any) => void; // assuming render is a function
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- let projects: ProjectsEntry[];
|
|
|
|
|
-
|
|
|
|
|
- onMount(async () => {
|
|
|
|
|
-
|
|
|
|
|
- console.log("test");
|
|
|
|
|
- projects = await getCollection('projects');
|
|
|
|
|
- console.log(projects);
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
-</script>
|
|
|
|
|
-
|
|
|
|
|
-<!-- Projects Section -->
|
|
|
|
|
-<section class="projects mt-5">
|
|
|
|
|
- <h2 class="text-3xl font-bold mb-4 dark:text-white">Projects</h2>
|
|
|
|
|
- <div class="grid grid-cols-1 gap-6">
|
|
|
|
|
- {#each projects as project}
|
|
|
|
|
- <article class="bg-white dark:bg-purple-700 rounded-lg shadow-md p-4">
|
|
|
|
|
- <h3 class="text-lg font-bold mb-2 dark:text-white">{project.data.title}</h3>
|
|
|
|
|
- <p class="text-gray-600 dark:text-white">This is the first project.</p>
|
|
|
|
|
- <a
|
|
|
|
|
- href="#"
|
|
|
|
|
- class="inline-block bg-blue-600 mt-3 hover:bg-blue-700 text-white py-2 px-4 rounded"
|
|
|
|
|
- >Demo</a
|
|
|
|
|
- >
|
|
|
|
|
- <a
|
|
|
|
|
- href="#"
|
|
|
|
|
- class="inline-block bg-orange-600 mt-3 hover:bg-orange-700 text-white py-2 px-4 rounded"
|
|
|
|
|
- >Source</a
|
|
|
|
|
- >
|
|
|
|
|
- </article>
|
|
|
|
|
- {/each}
|
|
|
|
|
- <article class="bg-white rounded-lg shadow-md p-4 dark:bg-purple-700">
|
|
|
|
|
- <h3 class="text-lg font-bold mb-2 dark:text-white">Project 2 Title</h3>
|
|
|
|
|
- <p class="text-gray-600 dark:text-white">This is the second project.</p>
|
|
|
|
|
- <a
|
|
|
|
|
- href="#"
|
|
|
|
|
- class="inline-block bg-blue-600 mt-3 hover:bg-blue-700 text-white py-2 px-4 rounded"
|
|
|
|
|
- >Demo</a
|
|
|
|
|
- >
|
|
|
|
|
- <a
|
|
|
|
|
- href="#"
|
|
|
|
|
- class="inline-block bg-orange-600 mt-3 hover:bg-orange-700 text-white py-2 px-4 rounded"
|
|
|
|
|
- >Source</a
|
|
|
|
|
- >
|
|
|
|
|
- </article>
|
|
|
|
|
- </div>
|
|
|
|
|
-</section>
|
|
|