Migrate Astro to latest version and update dependencies

- Updated Astro core package and related integrations to latest versions
- Added environment variable configuration in astro.config.mjs
- Removed deprecated migration plan and favicon.svg files
- Updated Search component to use onCleanup for proper effect cleanup
- Updated Appwrite service integration and configuration
- Removed old migration documentation and scripts
This commit is contained in:
Spaghet committed 2025-08-22 21:54:30 -04:00
1 parent e5ce8e4783
commit 73db6d2cd3
14 files changed
+197 -114

No files matched your search

+22 -2
View File
@@ -1,4 +1,4 @@
import { defineConfig } from "astro/config"
import { defineConfig, envField } from "astro/config"
import mdx from "@astrojs/mdx"
import sitemap from "@astrojs/sitemap"
import tailwind from "@astrojs/tailwind"
@@ -10,5 +10,25 @@ export default defineConfig({
site: "https://spaghet.io",
integrations: [mdx(), sitemap(), solidJs(), tailwind({ applyBaseStyles: false })],
output: "server",
adapter: node({ mode: "ssr" })
adapter: node({ mode: "ssr" }),
env: {
schema: {
VITE_APPWRITE_ENDPOINT: envField.string({ context: "server", access: "public" }),
VITE_APPWRITE_PROJECT_ID: envField.string({ context: "server", access: "public" }),
VITE_APPWRITE_BUCKET_ID: envField.string({ context: "server", access: "public" }),
VITE_APPWRITE_DATABASE_ID: envField.string({ context: "server", access: "public" }),
VITE_APPWRITE_BLOG_COLLECTION_ID: envField.string({ context: "server", access: "public" }),
VITE_APPWRITE_PROJECTS_COLLECTION_ID: envField.string({ context: "server", access: "public" }),
VITE_APPWRITE_WORK_COLLECTION_ID: envField.string({ context: "server", access: "public" }),
VITE_APPWRITE_LEGAL_COLLECTION_ID: envField.string({ context: "server", access: "public" }),
PUBLIC_APPWRITE_ENDPOINT: envField.string({ context: "client", access: "public" }),
PUBLIC_APPWRITE_PROJECT_ID: envField.string({ context: "client", access: "public" }),
PUBLIC_APPWRITE_BUCKET_ID: envField.string({ context: "client", access: "public" }),
PUBLIC_APPWRITE_DATABASE_ID: envField.string({ context: "client", access: "public" }),
PUBLIC_APPWRITE_BLOG_COLLECTION_ID: envField.string({ context: "client", access: "public" }),
PUBLIC_APPWRITE_PROJECTS_COLLECTION_ID: envField.string({ context: "client", access: "public" }),
PUBLIC_APPWRITE_WORK_COLLECTION_ID: envField.string({ context: "client", access: "public" }),
PUBLIC_APPWRITE_LEGAL_COLLECTION_ID: envField.string({ context: "client", access: "public" }),
}
}
})
Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

+5 -9
View File
@@ -1,9 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 128 128">
<path d="M50.4 78.5a75.1 75.1 0 0 0-28.5 6.9l24.2-65.7c.7-2 1.9-3.2 3.4-3.2h29c1.5 0 2.7 1.2 3.4 3.2l24.2 65.7s-11.6-7-28.5-7L67 45.5c-.4-1.7-1.6-2.8-2.9-2.8-1.3 0-2.5 1.1-2.9 2.7L50.4 78.5Zm-1.1 28.2Zm-4.2-20.2c-2 6.6-.6 15.8 4.2 20.2a17.5 17.5 0 0 1 .2-.7 5.5 5.5 0 0 1 5.7-4.5c2.8.1 4.3 1.5 4.7 4.7.2 1.1.2 2.3.2 3.5v.4c0 2.7.7 5.2 2.2 7.4a13 13 0 0 0 5.7 4.9v-.3l-.2-.3c-1.8-5.6-.5-9.5 4.4-12.8l1.5-1a73 73 0 0 0 3.2-2.2 16 16 0 0 0 6.8-11.4c.3-2 .1-4-.6-6l-.8.6-1.6 1a37 37 0 0 1-22.4 2.7c-5-.7-9.7-2-13.2-6.2Z" />
<style>
path { fill: #000; }
@media (prefers-color-scheme: dark) {
path { fill: #FFF; }
}
</style>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<image width="36" height="36" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAaYAAAGmCAYAAAA3cSADAAAgAElEQVR4nOydB7wkZZX2n6rqnG4Oc++dyOREGMIMSbKICIooiHENKPqt6xo/XcO6frprDgsqiq7ZdRV1QQQRyVEGGJicw507N9/u27G60vv9zlvV3dV974yDgjMD5++vvR2qq9+qHurpc97nPQd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ACcXWshNj8I5NPe9jmgkJZRjto+G9qSs6CsvNCNtLKjdaI3hcWnA3OWwwon4DR3SLu6MPJw5p8EpFoxq6MNB7ZuglPZh+vEkAVfpYhVhk3Rk1dkVjVKUNMjUPIZiHAMmWCiW1927hswZ0Uvdj/9IIqTXCCWYZijhheFZSsQCmPZZ3755eLS897vRkqmbHsuEZCN/EplA2WjDHNoD8SnLnLbVhwEpWUGlDknyHVMYmzftEVdU2tegeTqy1EORJHL5iHIpKAIiNw4nPV/grPj8SlroCTX/Btw5lXeB6Hm6iNDRCyKWLmAkf693tyTI0VOETbgiJqYVlx/woFimVBMXbr5Knk/p6UT9ox5QDgKWOYoHvj5Z/Hbr3wLRonr7zEMc8R5UURMC6/9zFvsM6/5D8u2Feosa8hICTKFRzfbsWXEJNNnpuFGTIeKavQ8xNAOWcFLine truncated
</svg>

Before

Width:  |  Height:  |  Size: 749 B

After

Width:  |  Height:  |  Size: 65 KiB

+3
View File
@@ -23,5 +23,8 @@
<symbol id="tailwind" viewBox="0 0 47 40" fill="none">
<path fill="#6366f1" d="M23.5 6.5C17.5 6.5 13.75 9.5 12.25 15.5C14.5 12.5 17.125 11.375 20.125 12.125C21.8367 12.5529 23.0601 13.7947 24.4142 15.1692C26.6202 17.4084 29.1734 20 34.75 20C40.75 20 44.5 17 46 11C43.75 14 41.125 15.125 38.125 14.375C36.4133 13.9471 35.1899 12.7053 33.8357 11.3308C31.6297 9.09158 29.0766 6.5 23.5 6.5ZM12.25 20C6.25 20 2.5 23 1 29C3.25 26 5.875 24.875 8.875 25.625C10.5867 26.0529 11.8101 27.2947 13.1642 28.6693C15.3702 30.9084 17.9234 33.5 23.5 33.5C29.5 33.5 33.25 30.5 34.75 24.5C32.5 27.5 29.875 28.625 26.875 27.875C25.1633 27.4471 23.9399 26.2053 22.5858 24.8307C20.3798 22.5916 17.8266 20 12.25 20Z"/>
</symbol>
<!-- appwrite icon-->
<symbol id="simple-icons--appwrite" viewBox="0 0 24 24"><path fill="currentColor" d="M24 17.291v5.29H10.557A10.58 10.58 0 0 1 0 12.715v-1.43c.048-.735.174-1.463.374-2.171C1.63 4.673 5.713 1.419 10.557 1.419s8.927 3.254 10.183 7.695h-5.749a5.28 5.28 0 0 0-4.434-2.404a5.28 5.28 0 0 0-4.434 2.404A5.23 5.23 0 0 0 5.267 12a5.27 5.27 0 0 0 1.66 3.848a5.27 5.27 0 0 0 3.63 1.443zm0-6.734v5.291h-9.813A5.28 5.28 0 0 0 15.848 12c0-.5-.07-.984-.199-1.443z"/></symbol>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

+8 -8
View File
@@ -9,34 +9,34 @@ type Props = {
export default function ArrowCard({entry, pill, collection}: Props) {
return (
<a href={`/${collection === 'blog' ? 'blog' : 'projects'}/${entry.$id}`} class="group p-4 gap-3 flex items-center border border-spaghetti-brown rounded-lg hover:bg-black/5 hover:dark:bg-white/10 border-black/15 dark:border-white/20 transition-colors duration-300 ease-in-out">
<div class="w-full group-hover:text-black group-hover:dark:text-white blend">
<a href={`/${collection === 'blog' ? 'blog' : 'projects'}/${entry.$id}`} class="group p-4 gap-3 flex items-center border border-spaghetti-brown rounded-lg hover:bg-spaghetti-red/5 hover:dark:bg-spaghetti-cream/10 dark:border-spaghetti-cream/20 transition-colors duration-300 ease-in-out">
<div class="w-full group-hover:text-spaghetti-red group-hover:dark:text-spaghetti-cream blend">
<div class="flex flex-wrap items-center gap-2">
{pill &&
<div class="text-sm capitalize px-2 py-0.5 rounded-full border border-black/15 dark:border-white/20 bg-spaghetti-yellow/20 dark:bg-spaghetti-yellow/20 dark:text-spaghetti-brown">
<div class="text-sm capitalize px-2 py-0.5 rounded-full border border-black/15 dark:border-spaghetti-cream/20 bg-spaghetti-yellow/20 dark:bg-spaghetti-yellow/20 dark:text-spaghetti-cream">
{collection === "blog" ? "post" : "project"}
</div>
}
<div class="text-sm uppercase">
<div class="text-sm uppercase text-spaghetti-brown dark:text-spaghetti-yellow">
{formatDate(entry.date)}
</div>
</div>
<div class="font-semibold mt-3 dark:text-spaghetti-brown">
<div class="font-semibold mt-3 text-spaghetti-brown/80 dark:text-spaghetti-cream">
{entry.title}
</div>
<div class="text-sm line-clamp-2 dark:text-spaghetti-brown">
<div class="text-sm line-clamp-2 text-spaghetti-brown/80 dark:text-spaghetti-cream">
{entry.summary}
</div>
<ul class="flex flex-wrap mt-2 gap-1">
{entry.tags.map((tag:string) => (
<li class="text-xs uppercase py-0.5 px-1 rounded bg-spaghetti-yellow/20 dark:bg-spaghetti-yellow/20 dark:text-spaghetti-brown">
<li class="text-xs uppercase py-0.5 px-1 rounded bg-spaghetti-yellow/20 dark:bg-spaghetti-yellow/20 text-spaghetti-brown/80 dark:text-spaghetti-yellow">
{tag}
</li>
))}
</ul>
</div>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="stroke-current group-hover:stroke-black group-hover:dark:stroke-white">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="stroke-current group-hover:stroke-black group-hover:dark:stroke-spaghetti-yellow">
<line x1="5" y1="12" x2="19" y2="12" class="scale-x-0 group-hover:scale-x-100 translate-x-4 group-hover:translate-x-1 transition-all duration-300 ease-in-out" />
<polyline points="12 5 19 12 12 19" class="translate-x-0 group-hover:translate-x-1 transition-all duration-300 ease-in-out" />
</svg>
+2 -2
View File
@@ -38,7 +38,7 @@ export default function Blog({ data, tags }: Props) {
<div class="grid grid-cols-1 sm:grid-cols-3 gap-6">
<div class="col-span-3 sm:col-span-1">
<div class="sticky top-24">
<div class="text-sm font-semibold uppercase mb-2 text-spaghetti-brown">Filter</div>
<div class="text-sm font-semibold uppercase mb-2 text-spaghetti-brown/80 dark:text-spaghetti-cream">Filter</div>
{/* Tag Filter */}
<div class="mb-2">
<div class="text-xs uppercase mb-1 text-spaghetti-brown/70">Tags</div>
@@ -46,7 +46,7 @@ export default function Blog({ data, tags }: Props) {
<For each={tags}>
{(tag) => (
<li>
<button onClick={() => toggleTag(tag)} class={cn("w-full px-2 py-1 rounded", "whitespace-nowrap overflow-hidden overflow-ellipsis", "flex gap-2 items-center", "bg-spaghetti-yellow/20 dark:bg-spaghetti-yellow/20", "hover:bg-spaghetti-yellow/30 hover:dark:bg-spaghetti-yellow/30", "transition-colors duration-300 ease-in-out", filter().has(tag) && "text-spaghetti-brown dark:text-spaghetti-brown")}>
<button onClick={() => toggleTag(tag)} class={cn("w-full px-2 py-1 rounded", "whitespace-nowrap overflow-hidden overflow-ellipsis", "flex gap-2 items-center", "bg-spaghetti-yellow/20 dark:bg-spaghetti-yellow/20", "hover:bg-spaghetti-yellow/30 hover:dark:bg-spaghetti-yellow/30", "transition-colors duration-300 ease-in-out", filter().has(tag) && "text-spaghetti-brown/80 dark:text-spaghetti-brown")}>
<svg class={cn("size-5 fill-spaghetti-brown/50 dark:fill-spaghetti-brown/50", "transition-colors duration-300 ease-in-out", filter().has(tag) && "fill-spaghetti-brown dark:fill-spaghetti-brown")}>
<use href={`/ui.svg#square`} class={cn(!filter().has(tag) ? "block" : "hidden")} />
<use href={`/ui.svg#square-check`} class={cn(filter().has(tag) ? "block" : "hidden")} />
+1 -1
View File
@@ -22,7 +22,7 @@ import Container from "@components/Container.astro"
<nav class="hidden md:flex items-center justify-center text-sm gap-1">
{
LINKS.map((LINK) => (
<a href={LINK.HREF} class={cn("h-8 rounded-full px-3 text-current", "flex items-center justify-center", "transition-colors duration-300 ease-in-out", pathname === LINK.HREF || "/" + subpath?.[0] === LINK.HREF ? "bg-spaghetti-red dark:bg-spaghetti-red text-spaghetti-brown dark:text-spaghetti-brown" : "hover:bg-black/5 dark:hover:bg-white/20 hover:text-black dark:hover:text-white")}>
<a href={LINK.HREF} class={cn("h-8 rounded-full px-3 text-current", "flex items-center justify-center", "transition-colors duration-300 ease-in-out", pathname === LINK.HREF || "/" + subpath?.[0] === LINK.HREF ? "bg-spaghetti-red dark:bg-spaghetti-cream text-black dark:text-spaghetti-brown" : "hover:bg-spaghetti-red/5 dark:hover:bg-spaghetti-red/20 hover:text-black dark:hover:text-white")}>
{LINK.TEXT}
</a>
))
+50 -25
View File
@@ -1,19 +1,22 @@
import type { BlogPost, Project } from "@lib/appwrite-service"
import { createEffect, createSignal } from "solid-js"
import { createEffect, createSignal, onCleanup } from "solid-js"
import ArrowCard from "@components/ArrowCard"
import { searchContent } from "@lib/appwrite-service"
type Props = {
// Remove the unused data prop
query?: string
}
export default function Search() {
const [query, setQuery] = createSignal("")
export default function Search(props: Props) {
const [query, setQuery] = createSignal(props.query || "")
const [results, setResults] = createSignal<{ posts: BlogPost[], projects: Project[] }>({ posts: [], projects: [] })
const [loading, setLoading] = createSignal(false)
const [error, setError] = createSignal<string | null>(null)
// Debounce timeout reference
let debounceTimeout: NodeJS.Timeout | null = null
// Use Appwrite SDK to search all data
// Use Appwrite SDK to search all data with debouncing
createEffect(() => {
if (query().length < 2) {
setResults({ posts: [], projects: [] })
@@ -21,21 +24,29 @@ export default function Search() {
return
}
setLoading(true)
searchContent(query())
.then(searchResults => {
setResults(searchResults)
setError(null)
})
.catch(err => {
console.error("Search error:", err)
// Handle error gracefully - maybe show an error message to user
setResults({ posts: [], projects: [] })
setError("Search failed. Please try again.")
})
.finally(() => {
setLoading(false)
})
// Clear previous timeout
if (debounceTimeout) {
clearTimeout(debounceTimeout)
}
// Set new debounce timeout
debounceTimeout = setTimeout(() => {
setLoading(true)
searchContent(query())
.then(searchResults => {
setResults(searchResults)
setError(null)
})
.catch(err => {
console.error("Search error:", err)
// Handle error gracefully - maybe show an error message to user
setResults({ posts: [], projects: [] })
setError("Search failed. Please try again.")
})
.finally(() => {
setLoading(false)
})
}, 300) // 300ms debounce delay
})
const onInput = (e: Event) => {
@@ -45,12 +56,26 @@ export default function Search() {
const handleSubmit = (e: Event) => {
e.preventDefault()
// The search will automatically trigger due to createEffect
// Prevent page refresh by using client-side navigation
if (query().length >= 2) {
// Search will automatically trigger due to createEffect
// Update URL without full page reload
const newUrl = `${window.location.pathname}?search=${encodeURIComponent(query())}`
window.history.pushState({}, "", newUrl)
// Dispatch custom event to update search results (removed for now - not needed with createEffect)
}
}
// Cleanup debounce timeout on component unmount
onCleanup(() => {
if (debounceTimeout) {
clearTimeout(debounceTimeout)
}
})
return (
<div class="flex flex-col">
<form onSubmit={handleSubmit} class="relative">
<form onSubmit={handleSubmit} class="relative" classList={{ "animate-pulse": loading() }}>
<input
name="search"
type="text"
@@ -66,7 +91,7 @@ export default function Search() {
</svg>
</form>
{error() && <div class="mt-4 text-red-500">{error()}</div>}
{loading() && <div class="mt-4">Searching...</div>}
{loading() && <div class="mt-4">Searching...<span class="ml-2 animate-spin">⏳</span></div>}
{(query().length >= 2 && (results().posts.length > 0 || results().projects.length > 0)) && (
<div class="mt-12">
<div class="text-sm uppercase mb-2">
@@ -79,7 +104,7 @@ export default function Search() {
<ul class="flex flex-col gap-3">
{results().posts.map(result => (
<li>
<ArrowCard entry={result} pill={true} />
<ArrowCard entry={result} pill={true} collection={'blog'} />
</li>
))}
</ul>
@@ -91,7 +116,7 @@ export default function Search() {
<ul class="flex flex-col gap-3">
{results().projects.map((result, index) => (
<li>
<ArrowCard entry={result} pill={true} />
<ArrowCard entry={result} pill={true} collection={'projects'} />
</li>
))}
</ul>
+7 -7
View File
@@ -51,17 +51,17 @@ if (collection === "blog") {
---
<div>
<article set:html={content} />
<article class="text-spaghetti-brown/80 dark:text-spaghetti-cream" set:html={content} />
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
{prevEntry && (
<a href={`/${collection}/${prevEntry.$id}`} class="group p-4 gap-3 flex items-center border rounded-lg hover:bg-black/5 hover:dark:bg-white/10 border-black/15 dark:border-white/20 blend">
<div class="order-2 w-full h-full group-hover:text-black group-hover:dark:text-white blend">
<a href={`/${collection}/${prevEntry.$id}`} class="group p-4 gap-3 flex items-center border rounded-lg hover:bg-black/5 hover:dark:bg-spaghetti-cream/10 border-black/15 dark:border-spaghetti-cream/20 blend">
<div class="order-2 w-full h-full group-hover:text-spaghetti-brown/80 group-hover:dark:text-spaghetti-cream blend">
<div class="flex flex-wrap gap-2">
<div class="text-sm uppercase">
Prev
</div>
</div>
<div class="font-semibold mt-3 text-black dark:text-white">
<div class="font-semibold mt-3 text-spaghetti-brown/80 dark:text-spaghetti-cream">
{prevEntry.title}
</div>
</div>
@@ -72,12 +72,12 @@ if (collection === "blog") {
</a>
)}
{nextEntry && (
<a href={`/${collection}/${nextEntry.$id}`} class="group p-4 gap-3 flex items-center border rounded-lg hover:bg-black/5 hover:dark:bg-white/10 border-black/15 dark:border-white/20 transition-colors duration-300 ease-in-out">
<div class="w-full h-full text-right group-hover:text-black group-hover:dark:text-white blend">
<a href={`/${collection}/${nextEntry.$id}`} class="group p-4 gap-3 flex items-center border rounded-lg hover:bg-black/5 hover:dark:bg-spaghetti-cream/10 border-black/15 dark:border-spaghetti-cream/20 transition-colors duration-300 ease-in-out">
<div class="w-full h-full text-right group-hover:text-spaghetti-brown/80 group-hover:dark:text-spaghetti-cream blend">
<div class="text-sm uppercase">
Next
</div>
<div class="font-semibold mt-3 text-black dark:text-white">
<div class="font-semibold mt-3 text-spaghetti-brown/80 dark:text-spaghetti-cream">
{nextEntry.title}
</div>
</div>
+2 -2
View File
@@ -39,10 +39,10 @@ const body = entry.content
{readingTime(body)}
</div>
</div>
<h1 class="text-3xl font-semibold text-spaghetti-brown dark:text-spaghetti-brown mt-2">
<h1 class="text-3xl font-semibold text-spaghetti-brown/100 dark:text-spaghetti-cream mt-2">
{title}
</h1>
<div class="mt-1 text-spaghetti-brown dark:text-spaghetti-brown">
<div class="mt-1 text-spaghetti-brown/80 dark:text-spaghetti-cream">
{summary}
</div>
{(demoUrl || repoUrl) &&
+63 -36
View File
@@ -79,14 +79,24 @@ export type LegalDocument = Models.Document & {
export type SearchEntry = BlogPost | Project;
// Collection IDs - these should be configured based on your Appwrite setup
const BLOG_COLLECTION_ID = process.env.VITE_APPWRITE_BLOG_COLLECTION_ID || "blog";
const PROJECTS_COLLECTION_ID = process.env.VITE_APPWRITE_PROJECTS_COLLECTION_ID || "project";
const WORK_COLLECTION_ID = process.env.VITE_APPWRITE_WORK_COLLECTION_ID || "work";
const LEGAL_COLLECTION_ID = process.env.VITE_APPWRITE_LEGAL_COLLECTION_ID || "legal";
// Database ID - should be configured based on your Appwrite setup
const DATABASE_ID = process.env.VITE_APPWRITE_DATABASE_ID || "main";
let blogCollection = '', projectsCollection = '', workCollection = '', legalCollection = '', databaseID = '';
// Check if we're in a server environment (SSR)
if (typeof window === 'undefined') {
// Server-side: use environment variables directly
blogCollection = process?.env?.VITE_APPWRITE_BLOG_COLLECTION_ID || 'blog';
projectsCollection = process?.env?.VITE_APPWRITE_PROJECTS_COLLECTION_ID || "projects";
workCollection = process?.env?.VITE_APPWRITE_WORK_COLLECTION_ID || "work";
legalCollection = process?.env?.VITE_APPWRITE_LEGAL_COLLECTION_ID || "legal";
databaseID = process.env.VITE_APPWRITE_DATABASE_ID || "main";
} else {
blogCollection = import.meta.env.PUBLIC_APPWRITE_BLOG_COLLECTION_ID || 'blog';
projectsCollection = import.meta.env.PUBLIC_APPWRITE_PROJECTS_COLLECTION_ID || "projects";
workCollection = import.meta.env.PUBLIC_APPWRITE_WORK_COLLECTION_ID || "work";
legalCollection = import.meta.env.PUBLIC_APPWRITE_LEGAL_COLLECTION_ID || "legal";
databaseID = import.meta.env.PUBLIC_APPWRITE_DATABASE_ID || "main";
}
/**
* Get blog posts from Appwrite database
@@ -94,8 +104,8 @@ const DATABASE_ID = process.env.VITE_APPWRITE_DATABASE_ID || "main";
export async function getBlogPosts(): Promise<BlogPost[]> {
try {
const response = await databases.listDocuments<BlogPost>(
DATABASE_ID,
BLOG_COLLECTION_ID
databaseID,
blogCollection
);
// Convert markdown content to HTML for each post
@@ -119,11 +129,12 @@ export async function getBlogPostsPaginated(page: number, limit: number): Promis
try {
// For Appwrite SDK, the correct way to call listDocuments with pagination
const response = await databases.listDocuments<BlogPost>(
DATABASE_ID,
BLOG_COLLECTION_ID,
databaseID,
blogCollection,
[
// Only fetch published posts (not drafts)
Query.equal("draft", false)
Query.equal("draft", false),
Query.orderDesc('date')
]
);
@@ -153,8 +164,8 @@ export async function getBlogPostsPaginated(page: number, limit: number): Promis
export async function getBlogPostById(id: string): Promise<BlogPost> {
try {
const response = await databases.getDocument<BlogPost>(
DATABASE_ID,
BLOG_COLLECTION_ID,
databaseID,
blogCollection,
id
);
@@ -175,10 +186,12 @@ export async function getBlogPostById(id: string): Promise<BlogPost> {
export async function getProjects(): Promise<Project[]> {
try {
const response = await databases.listDocuments<Project>(
DATABASE_ID,
PROJECTS_COLLECTION_ID,
databaseID,
projectsCollection,
[
// Only fetch published projects (not drafts)
Query.equal("draft", false),
Query.orderDesc('date')
]
);
@@ -202,11 +215,12 @@ export async function getProjects(): Promise<Project[]> {
export async function getProjectsPaginated(page: number, limit: number): Promise<{ posts: Project[], total: number }> {
try {
const response = await databases.listDocuments<Project>(
DATABASE_ID,
PROJECTS_COLLECTION_ID,
databaseID,
projectsCollection,
[
// Only fetch published projects (not drafts)
Query.equal("draft", false)
Query.equal("draft", false),
Query.orderDesc('date')
]
);
@@ -236,8 +250,8 @@ export async function getProjectsPaginated(page: number, limit: number): Promise
export async function getProjectById(id: string): Promise<Project> {
try {
const response = await databases.getDocument<Project>(
DATABASE_ID,
PROJECTS_COLLECTION_ID,
databaseID,
projectsCollection,
id
);
@@ -259,8 +273,8 @@ export async function getProjectById(id: string): Promise<Project> {
export async function getWorkExperiences(): Promise<WorkExperience[]> {
try {
const response = await databases.listDocuments<WorkExperience>(
DATABASE_ID,
WORK_COLLECTION_ID
databaseID,
workCollection
);
// Convert markdown content to HTML for each project
@@ -280,8 +294,8 @@ export async function getWorkExperiences(): Promise<WorkExperience[]> {
export async function getLegalDocuments(): Promise<LegalDocument[]> {
try {
const response = await databases.listDocuments<LegalDocument>(
DATABASE_ID,
LEGAL_COLLECTION_ID
databaseID,
workCollection
);
return response.documents;
@@ -298,25 +312,35 @@ export async function searchContent(query: string): Promise<{ posts: BlogPost[],
try {
// Search in blog collection for the query term
const blogResponse = await databases.listDocuments<BlogPost>(
DATABASE_ID,
BLOG_COLLECTION_ID,
databaseID,
blogCollection,
[
Query.equal("draft", false),
Query.search("title", query),
Query.search("summary", query),
Query.search("content", query)
Query.and([
Query.equal("draft", false),
Query.or([
Query.search("title", query),
Query.search("summary", query),
Query.search("content", query)
])
]),
Query.orderDesc('date')
]
);
// Search in projects collection for the query term
const projectResponse = await databases.listDocuments<Project>(
DATABASE_ID,
PROJECTS_COLLECTION_ID,
databaseID,
projectsCollection,
[
Query.equal("draft", false),
Query.search("title", query),
Query.search("summary", query),
Query.search("content", query)
Query.and([
Query.equal("draft", false),
Query.or([
Query.search("title", query),
Query.search("summary", query),
Query.search("content", query)
])
]),
Query.orderDesc('date')
]
);
@@ -346,6 +370,9 @@ export async function searchContent(query: string): Promise<{ posts: BlogPost[],
}
}
// Remove the duplicate function - keep only the original searchContent function
// The original searchContent function is already correctly implemented and should be used
/**
* Get a public URL for a file
+3 -3
View File
@@ -16,9 +16,9 @@ if (typeof window === 'undefined') {
.setEndpoint(endpoint) // Your Appwrite endpoint
.setProject(projectId); // Your Project ID
} else {
// Client-side: use import.meta.env
const endpoint = import.meta.env.VITE_APPWRITE_ENDPOINT;
const projectId = import.meta.env.VITE_APPWRITE_PROJECT_ID;
// Client-side: use import.meta.env (need to prefix with PUBLIC_ for Astro to make them available)
const endpoint = import.meta.env.PUBLIC_APPWRITE_ENDPOINT;
const projectId = import.meta.env.PUBLIC_APPWRITE_PROJECT_ID;
if (!endpoint || !projectId) {
throw new Error('Appwrite configuration missing in client environment');
+22 -17
View File
@@ -39,6 +39,11 @@ const stack = [
icon: "tailwind",
href: "https://tailwindcss.com"
},
{
text: "Appwrite",
icon: "simple-icons--appwrite",
href: "https://appwrite.io"
}
]
---
@@ -78,29 +83,29 @@ const stack = [
</div>
</div>
<div class="animate absolute h-full w-full flex items-center justify-center">
<div class='relative w-full h-full flex items-center justify-center'>
<div class='relative w-full h-full flex items-center justify-center text-spaghetti-brown/100 dark:text-spaghetti-cream'>
<div class='p-5 text-center'>
<img src='/api/assets/689d27a400194d326f69' alt="Quinn Marvin" class="rounded-full w-32 h-32 mx-auto mb-4 border-4 border-spaghetti-red" />
<p class='animated text-lg md:text-xl lg:text-2xl font-semibold opacity-75 dark:text-spaghetti-brown'>
<img src='/api/assets/689d27a400194d326f69' alt="Quinn Marvin" class="rounded-full w-32 h-32 mx-auto mb-4 border-4 border-spaghetti-brown dark:border-spaghetti-cream" />
<p class='animated text-lg md:text-xl lg:text-2xl font-semibold opacity-75'>
Hello, I am Quinn Marvin
</p>
<p class='animated text-2xl md:text-3xl lg:text-4xl font-bold uppercase dark:text-spaghetti-brown'>
<p class='animated text-2xl md:text-3xl lg:text-4xl font-bold uppercase'>
CEO / Creator / Innovator
</p>
<p class='animated text-sm md:text-base lg:text-lg opacity-75 dark:text-spaghetti-brown'>
<p class='animated text-sm md:text-base lg:text-lg opacity-75'>
Passionate about spaghetti, noodles and all things tech.
</p>
<p class='animated text-sm md:text-base lg:text-lg opacity-75 mt-2 dark:text-spaghetti-brown'>
<p class='animated text-sm md:text-base lg:text-lg opacity-75 mt-2'>
Running 2 Unraid servers with Docker container ecosystem
</p>
<p class='animated text-sm md:text-base lg:text-lg opacity-75 mt-1 dark:text-spaghetti-brown'>
<p class='animated text-sm md:text-base lg:text-lg opacity-75 mt-1'>
Supporting PostgreSQL, MariaDB, MySQL, MongoDB, Redis, and Minio
</p>
<div id="ctaButtons" class='animated flex flex-wrap gap-4 justify-center mt-5'>
<a href='/blog' class='py-2 px-4 rounded truncate text-xs md:text-sm lg:text-base bg-spaghetti-red dark:bg-spaghetti-red dark:text-spaghetti-brown hover:opacity-75 blend'>
Read my blog
</a>
<a href='/work' class='py-2 px-4 truncate rounded text-xs md:text-sm lg:text-base border border-spaghetti-yellow/50 dark:border-spaghetti-yellow/50 hover:bg-spaghetti-yellow/20 hover:dark:bg-spaghetti-yellow/20 blend dark:text-spaghetti-brown'>
<a href='/work' class='py-2 px-4 truncate rounded text-xs md:text-sm lg:text-base border border-spaghetti-yellow/50 dark:border-spaghetti-yellow/50 hover:bg-spaghetti-yellow/20 hover:dark:bg-spaghetti-yellow/20 blend dark:text-spaghetti-cream'>
View my work
</a>
</div>
@@ -113,8 +118,8 @@ const stack = [
<div class="mx-auto max-w-screen-sm p-5 space-y-24 pb-16">
<!-- About Section -->
<section class="animate dark:text-spaghetti-brown">
<article>
<section class="animate">
<article class="text-spaghetti-brown/100 dark:text-spaghetti-cream">
<p>Hello! I'm Quinn Marvin, a passionate CEO/Creator/Innovator with an unrelenting love for spaghetti, noodles, and all things tech.</p>
<p>With 10+ years of experience building high-performing engineering teams and driving innovation in dynamic environments, I combine deep technical expertise with exceptional emotional intelligence and a human-centered leadership approach.</p>
<p>I specialize in IT Service Management (ITSM), IT Operations Management (ITOM), and IT Asset Management (ITAM), positioning myself as a trusted advisor to enterprise clients.</p>
@@ -128,7 +133,7 @@ const stack = [
<section class="animate">
<div class="space-y-4">
<div class="flex justify-between">
<p class="font-semibold text-black dark:text-white">
<p class="font-semibold text-spaghetti-brown dark:text-spaghetti-cream">
Recent posts
</p>
<a href="/blog" class="w-fit col-span-3 group flex gap-1 items-center underline decoration-[.5px] decoration-black/25 dark:decoration-white/50 hover:decoration-black dark:hover:decoration-white text-black dark:text-white underline-offset-2 blend">
@@ -150,7 +155,7 @@ const stack = [
<!-- Tech Stack Section -->
<section class="animate">
<div class="space-y-4">
<p class="font-semibold text-black dark:text-white">
<p class="font-semibold text-spaghetti-brown dark:text-spaghetti-cream">
Website build with
</p>
<div class="flex flex-wrap items-center gap-2 mt-5">
@@ -162,10 +167,10 @@ const stack = [
/>
))}
</div>
<div>
<div class="dark:text-spaghetti-cream">
Performing reactivity and statefulness, special guest
<a href="https://www.solidjs.com/" target="_blank" class="w-fit group underline decoration-[.5px] decoration-black/25 dark:decoration-white/50 hover:decoration-black dark:hover:decoration-white text-black dark:text-white underline-offset-2 blend">
<span class="text-black/75 dark:text-white/75 group-hover:text-black group-hover:dark:text-white blend">
<span class="text-spaghetti-brown/75 dark:text-spaghetti-cream/75 group-hover:text-spaghetti-brown group-hover:dark:text-spaghetti-cream blend">
SolidJS
</span>
</a>
@@ -177,7 +182,7 @@ const stack = [
<section class="animate">
<div class="space-y-4">
<div class="flex justify-between">
<p class="font-semibold text-black dark:text-white">
<p class="font-semibold text-spaghetti-brown dark:text-spaghetti-cream">
Recent projects
</p>
<a href="/projects" class="w-fit col-span-3 group flex gap-1 items-center underline decoration-[.5px] decoration-black/25 dark:decoration-white/50 hover:decoration-black dark:hover:decoration-white text-black dark:text-white underline-offset-2 blend">
@@ -198,8 +203,8 @@ const stack = [
<!-- Contact Section -->
<section class="animate">
<div>
<p class="font-semibold text-black dark:text-white">
<div class=" text-spaghetti-brown dark:text-spaghetti-cream">
<p class="font-semibold">
Let's Connect
</p>
<p>
+9 -2
View File
@@ -7,6 +7,13 @@ import { SEARCH } from "@consts"
// The search page now uses client-side search with Appwrite SDK directly
// No need to pre-load all data as the Search component handles this via API calls
// Handle URL search parameters - add proper client-side handling for search query
const url = new URL(typeof window !== 'undefined' ? window.location.href : 'http://localhost')
const searchParam = url.searchParams.get('search') || ''
// Pass initial search query to component if present in URL
const initialQuery = searchParam
---
<PageLayout title={SEARCH.TITLE} description={SEARCH.DESCRIPTION}>
@@ -16,8 +23,8 @@ import { SEARCH } from "@consts"
</div>
</TopLayout>
<BottomLayout>
<div class="animate">
<Search client:load/>
<div class="animate" id="search-container">
<Search client:load query={initialQuery}/>
</div>
</BottomLayout>
</PageLayout>