diff --git a/src/content/blog/sample-post.md b/src/content/blog/sample-post.md new file mode 100644 index 0000000..6a94cd0 --- /dev/null +++ b/src/content/blog/sample-post.md @@ -0,0 +1,26 @@ +--- +title: "Welcome to My Portfolio" +description: "First post to validate content collections setup" +publishDate: 2026-05-08 +tags: ["meta", "announcement"] +category: "personal" +featured: true +draft: true +--- + +# Welcome + +This is a sample blog post to validate that content collections are working correctly. + +## Features +- Markdown content with frontmatter validation +- Type-safe schema with Zod +- Automatic type generation for TypeScript + +## Code Example +```typescript +const greeting = "Hello, World!"; +console.log(greeting); +``` + +This post will be replaced with real content later. \ No newline at end of file diff --git a/src/content/config.ts b/src/content/config.ts new file mode 100644 index 0000000..0badf67 --- /dev/null +++ b/src/content/config.ts @@ -0,0 +1,31 @@ +import { defineCollection, z } from 'astro:content'; + +const blog = defineCollection({ + schema: z.object({ + title: z.string(), + description: z.string(), + publishDate: z.coerce.date(), + author: z.string().default('David Aragón'), + tags: z.array(z.string()), + category: z.enum(['technical', 'business', 'personal']), + featured: z.boolean().default(false), + draft: z.boolean().default(false), + image: z.string().optional(), + }), +}); + +const projects = defineCollection({ + schema: z.object({ + title: z.string(), + description: z.string(), + url: z.string().url(), + github: z.string().url().optional(), + status: z.enum(['active', 'development', 'completed']), + tags: z.array(z.string()), + startDate: z.coerce.date(), + featured: z.boolean().default(false), + image: z.string().optional(), + }), +}); + +export const collections = { blog, projects }; \ No newline at end of file diff --git a/src/content/projects/sample-project.md b/src/content/projects/sample-project.md new file mode 100644 index 0000000..2071028 --- /dev/null +++ b/src/content/projects/sample-project.md @@ -0,0 +1,21 @@ +--- +title: "Sample Project" +description: "Test project for content collections validation" +url: "https://example.com" +status: "development" +tags: ["test"] +startDate: 2026-05-08 +featured: false +draft: true +--- + +# Sample Project + +This is a placeholder project to validate content collections. + +## Tech Stack +- Astro +- TypeScript +- Tailwind CSS + +This will be replaced with real project case studies. \ No newline at end of file diff --git a/src/pages/index.astro b/src/pages/index.astro index 561196b..97cfa3f 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,17 +1,166 @@ --- +import BaseLayout from '../layouts/BaseLayout.astro'; +import Header from '../components/layout/Header.astro'; +import Footer from '../components/layout/Footer.astro'; +import Card from '../components/ui/Card.astro'; +import Tag from '../components/ui/Tag.astro'; +import { getCollection } from 'astro:content'; +import { formatDate } from '../utils/dateFormat'; + +// Fetch featured projects and recent blog posts +const projects = (await getCollection('projects')) + .filter(p => !p.data.draft && p.data.featured) + .slice(0, 3); + +const blogPosts = (await getCollection('blog')) + .filter(p => !p.data.draft) + .sort((a, b) => b.data.publishDate.getTime() - a.data.publishDate.getTime()) + .slice(0, 3); +--- ---- + +
+ +
+ +
+

+ Hola, soy David Aragón +

+

+ Indie builder español construyendo en público. Trabajando hacia €4M ARR + con un portfolio de productos SaaS enfocados en compliance y automatización. +

+ +
- - - - - - - - Astro - - -

Astro

- - + +
+
+

Proyectos Destacados

+ + Ver todos → + +
+ +
+ {projects.length > 0 ? ( + projects.map(project => ( + +

{project.data.title}

+

{project.data.description}

+
+ {project.data.tags.slice(0, 3).map(tag => ( + + ))} +
+
+ {project.data.status} + Ver proyecto → +
+
+ )) + ) : ( +
+

+ Proyectos destacados próximamente. Mientras tanto, + lee el blog. +

+
+ )} +
+
+ + +
+
+

Últimas Publicaciones

+ + Ver todas → + +
+ +
+ {blogPosts.length > 0 ? ( + blogPosts.map(post => ( + +
+ +
+

{post.data.title}

+

{post.data.description}

+
+ + Leer más → +
+
+ )) + ) : ( +
+

+ Publicaciones próximamente. Suscríbete para recibir actualizaciones. +

+
+ )} +
+
+ + +
+
+

Construyendo en Público

+

+ Suscríbete para recibir actualizaciones sobre nuevos proyectos, aprendizajes, + y transparencia total en el viaje hacia €4M ARR. +

+
+ + +
+

+ Sin spam. Cancela cuando quieras. +

+
+
+
+ +