--- import { getCollection } from 'astro:content'; import BaseLayout from '../layouts/BaseLayout.astro'; // Corrected path import KnowledgeGraph from '../components/KnowledgeGraph.astro'; // Corrected path import Terminal from '../components/Terminal.astro'; // Corrected path import Header from '../components/Header.astro'; // Import Header import Footer from '../components/Footer.astro'; // Import Footer // Get all blog entries const allPosts = await getCollection('posts'); // Sort by publication date const sortedPosts = allPosts.sort((a, b) => { const dateA = a.data.pubDate ? new Date(a.data.pubDate) : new Date(0); const dateB = b.data.pubDate ? new Date(b.data.pubDate) : new Date(0); return dateB.getTime() - dateA.getTime(); }); // Get all unique tags const allTags = [...new Set(allPosts.flatMap(post => post.data.tags || []))].sort(); // Get all unique categories const allCategories = [...new Set(allPosts.map(post => post.data.category).filter(Boolean))].sort(); // Prepare post data for client-side filtering and knowledge graph const postsData = sortedPosts.map(post => ({ slug: post.slug, title: post.data.title, description: post.data.description || '', pubDate: post.data.pubDate ? new Date(post.data.pubDate).toLocaleDateString('en-us', { year: 'numeric', month: 'short', day: 'numeric' }) : 'No date', pubDateISO: post.data.pubDate ? new Date(post.data.pubDate).toISOString() : '', category: post.data.category || 'Uncategorized', tags: post.data.tags || [], heroImage: post.data.heroImage || '/images/placeholders/default.jpg', readTime: post.data.readTime || '5 min read', isDraft: post.data.draft || false })); // Prepare graph data (Obsidian-style: Posts and Tags) const graphNodes = []; const graphEdges = []; const tagNodes = new Map(); // To avoid duplicate tag nodes // Add post nodes sortedPosts.forEach(post => { if (!post.data.draft) { // Exclude drafts from graph graphNodes.push({ id: post.slug, label: post.data.title, type: 'post', // Add type for styling/interaction url: `/posts/${post.slug}/` // Add URL for linking }); // Add tag nodes and edges (post.data.tags || []).forEach(tag => { const tagId = `tag-${tag}`; // Add tag node only if it doesn't exist if (!tagNodes.has(tagId)) { graphNodes.push({ id: tagId, label: `#${tag}`, // Prefix with # for clarity type: 'tag' // Add type }); tagNodes.set(tagId, true); } // Add edge connecting post to tag graphEdges.push({ source: post.slug, target: tagId, type: 'tag-connection' // Add type }); }); } }); const graphData = { nodes: graphNodes, edges: graphEdges }; // Terminal commands for tech effect const commands = [ { prompt: "[laforceit@argobox]$ ", command: "find ./posts -type f -name \"*.md\" | sort -n | wc -l", output: [`${allPosts.length} posts found`] }, { prompt: "[laforceit@argobox]$ ", command: "ls -la ./categories", output: allCategories.map(cat => `${cat}`) }, { prompt: "[laforceit@argobox]$ ", command: "grep -r \"kubernetes\" --include=\"*.md\" ./posts | wc -l", output: [`${allPosts.filter(post => post.data.tags?.includes('kubernetes') || post.data.category === 'Kubernetes' || post.data.title?.toLowerCase().includes('kubernetes') || post.data.description?.toLowerCase().includes('kubernetes') ).length} matches found`] } ]; ---
{/* Pass Header to slot */}
{/* Hero Section with Terminal */}
Technical Articles & Guides

Exploring advanced infrastructure and automation

Dive into enterprise-grade home lab setups, Kubernetes deployments, and DevOps best practices for the modern tech enthusiast.

{/* Blog Posts Section */}

Latest Articles

Technical insights, infrastructure guides, and DevOps best practices

{/* Search and Filter Section */}
Filter by Tag: {allTags.map(tag => ( ))}
{/* Integrated Knowledge Graph */}
{/* We will update graphData generation later */}
{/* Blog Grid (will be populated by JS) */}
Loading articles...