chore: migrate hosting documentation from Appwrite to self-hosted
Update README.md and astro.config.mjs to reflect the migration from Appwrite to self-hosted infrastructure. Remove Appwrite-specific environment variable schema from Astro config. Add .clinerules and .cline to .gitignore.
This commit is contained in:
1 parent
d86f78fead
commit
ac545c4668
53 files changed
+4109
-5117
No files matched your search
+25
-17
@@ -1,10 +1,11 @@
|
||||
import type { BlogPost, Project } from "@lib/appwrite-service"
|
||||
import type { BlogPost, Project } from "@lib/types"
|
||||
import { createEffect, createSignal, onCleanup } from "solid-js"
|
||||
import ArrowCard from "@components/ArrowCard"
|
||||
import { searchContent } from "@lib/appwrite-service"
|
||||
|
||||
type Props = {
|
||||
query?: string
|
||||
posts?: BlogPost[]
|
||||
projects?: Project[]
|
||||
}
|
||||
|
||||
export default function Search(props: Props) {
|
||||
@@ -16,7 +17,7 @@ export default function Search(props: Props) {
|
||||
// Debounce timeout reference
|
||||
let debounceTimeout: NodeJS.Timeout | null = null
|
||||
|
||||
// Use Appwrite SDK to search all data with debouncing
|
||||
// Client-side search through provided data
|
||||
createEffect(() => {
|
||||
if (query().length < 2) {
|
||||
setResults({ posts: [], projects: [] })
|
||||
@@ -32,20 +33,27 @@ export default function Search(props: Props) {
|
||||
// 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)
|
||||
})
|
||||
try {
|
||||
const q = query().toLowerCase()
|
||||
const filteredPosts = (props.posts || []).filter(post =>
|
||||
post.title.toLowerCase().includes(q) ||
|
||||
post.summary.toLowerCase().includes(q) ||
|
||||
post.tags.some(tag => tag.toLowerCase().includes(q))
|
||||
)
|
||||
const filteredProjects = (props.projects || []).filter(project =>
|
||||
project.title.toLowerCase().includes(q) ||
|
||||
project.summary.toLowerCase().includes(q) ||
|
||||
project.tags.some(tag => tag.toLowerCase().includes(q))
|
||||
)
|
||||
setResults({ posts: filteredPosts, projects: filteredProjects })
|
||||
setError(null)
|
||||
} catch (err) {
|
||||
console.error("Search error:", err)
|
||||
setResults({ posts: [], projects: [] })
|
||||
setError("Search failed. Please try again.")
|
||||
} finally {
|
||||
setLoading(false)
|
||||
}
|
||||
}, 300) // 300ms debounce delay
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user