From 6497f5dfb837739c7ab53713c029a7575250618e Mon Sep 17 00:00:00 2001 From: Justin Deal Date: Sat, 3 May 2025 02:35:37 -0700 Subject: [PATCH] update tag styling to be consistent --- src/layouts/BlogLayout.astro | 6 ++-- src/layouts/ProjectLayout.astro | 4 +-- src/lib/utils.ts | 63 ++++++++++++++++++++++----------- src/pages/blog/html-intro.md | 53 +++++++++++++++++++++++++-- 4 files changed, 98 insertions(+), 28 deletions(-) diff --git a/src/layouts/BlogLayout.astro b/src/layouts/BlogLayout.astro index 9e8aa0b..a98a06a 100644 --- a/src/layouts/BlogLayout.astro +++ b/src/layouts/BlogLayout.astro @@ -50,13 +50,13 @@ const sourceUrl = generateSourceUrl(frontmatter.filename, "blog"); -
+
{frontmatter.tags?.map((tag) => ( - + {tag} ))}
-

~{GLOBAL.username}

+

~{GLOBAL.username}

diff --git a/src/layouts/ProjectLayout.astro b/src/layouts/ProjectLayout.astro index a911868..6d51afc 100644 --- a/src/layouts/ProjectLayout.astro +++ b/src/layouts/ProjectLayout.astro @@ -37,11 +37,11 @@ const sourceUrl = generateSourceUrl(frontmatter.filename, "projects");

{frontmatter.title}

-
+
{ frontmatter.tags ? frontmatter.tags.map((tag) => ( - + {tag} )) diff --git a/src/lib/utils.ts b/src/lib/utils.ts index cecbf65..efec2be 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -28,29 +28,50 @@ export const processContentInDir = async ( .filter((file: string) => file.endsWith(".md")) .map((file) => file.split(".")[0]); const readMdFileContent = async (file: string) => { - if (contentType === "projects") { - const content = import.meta - .glob(`/src/pages/projects/*.md`) - [`/src/pages/projects/${file}.md`](); - const data = (await content) as { - frontmatter: T; - file: string; - url: string; - }; - return processFn(data); - } else { - const content = import.meta - .glob(`/src/pages/blog/*.md`) - [`/src/pages/blog/${file}.md`](); - const data = (await content) as { - frontmatter: T; - file: string; - url: string; - }; - return processFn(data); + try { + if (contentType === "projects") { + const content = import.meta + .glob(`/src/pages/projects/*.md`) + [`/src/pages/projects/${file}.md`](); + const data = (await content) as { + frontmatter: T; + file: string; + url: string; + }; + + // Validate frontmatter before processing + if (!data || !data.frontmatter) { + console.warn(`Warning: Missing or invalid frontmatter in ${file}.md`); + return null; + } + + return processFn(data); + } else { + const content = import.meta + .glob(`/src/pages/blog/*.md`) + [`/src/pages/blog/${file}.md`](); + const data = (await content) as { + frontmatter: T; + file: string; + url: string; + }; + + // Validate frontmatter before processing + if (!data || !data.frontmatter) { + console.warn(`Warning: Missing or invalid frontmatter in ${file}.md`); + return null; + } + + return processFn(data); + } + } catch (error) { + console.error(`Error processing ${file}.md:`, error); + return null; } }; - return await Promise.all(markdownFiles.map(readMdFileContent)); + const results = await Promise.all(markdownFiles.map(readMdFileContent)); + // Filter out null results from files with errors + return results.filter(result => result !== null) as K[]; }; /** diff --git a/src/pages/blog/html-intro.md b/src/pages/blog/html-intro.md index 0cc0f89..b23c952 100644 --- a/src/pages/blog/html-intro.md +++ b/src/pages/blog/html-intro.md @@ -2,9 +2,58 @@ layout: ../../layouts/BlogLayout.astro title: No, We Have Netflix at Home description: How my exasperation at paying for an ever growing number of streaming services led to a deep obsession -tags: ["code", "htmlf"] +tags: ["code", "html", "homelab"] time: 4 featured: true timestamp: 2024-12-18T02:39:03+00:00 filename: html-intro ---- \ No newline at end of file +--- + +## The Beginning of an Obsession + +It all started with a simple thought: "Why am I paying for so many streaming services?" Netflix, Hulu, Disney+, HBO Max, Apple TV+, and the list goes on. Each one offering just enough exclusive content to justify its monthly fee, but collectively draining my wallet. + +That's when I decided to take matters into my own hands and build my own media server. Little did I know this would be the gateway to a much deeper homelab obsession. + +## The First Steps + +I started with a simple Plex server running on an old laptop. It wasn't much, but it was mine. I could store my legally obtained media and stream it to any device in my home. The convenience was immediately apparent, and the satisfaction of building something myself was addictive. + +But as with any tech hobby, it didn't stop there. Soon I was researching NAS solutions, RAID configurations, and the best hard drives for 24/7 operation. My simple media server was evolving into something much more complex. + +## Expanding Horizons + +As my collection grew, so did my ambitions. I found myself exploring other self-hosted applications: + +- **Sonarr and Radarr** for managing TV shows and movies +- **Jackett** for indexing +- **Ombi** for allowing family members to request content +- **Tautulli** for monitoring Plex usage + +Each new addition made my system more powerful and more tailored to my specific needs. I was no longer just replicating Netflix; I was building something better. + +## The Current Setup + +Today, my homelab has expanded well beyond just media. It now includes: + +- A proper NAS with redundant storage +- Docker containers for various services +- Home automation integration +- VPN for remote access +- Automated backups + +The journey from "I don't want to pay for Netflix" to "I need more hard drives for my server rack" happened almost without me noticing. But I wouldn't have it any other way. + +## Lessons Learned + +If you're considering starting your own homelab journey, here's what I've learned: + +1. **Start small** - You don't need enterprise hardware to begin +2. **Document everything** - You'll thank yourself later +3. **Backup, backup, backup** - Data loss is painful +4. **Join the community** - r/homelab and other forums are invaluable resources +5. **Enjoy the process** - The learning is half the fun + +So while my family jokes about having "Netflix at home," I smile knowing that what we have is so much more than just another streaming service. It's a hobby, a learning experience, and a constantly evolving project that brings me joy. + +And yes, it's probably cost me more than just paying for those streaming services would have. But where's the fun in that?