refactor: Reorganize project structure and update dependencies
- Removed blog, project, and work content files - Updated package dependencies including npm and removed license metadata - Refactored component layouts and page routes - Modified appwrite service for data operations
This commit is contained in:
1 parent
7997eccb12
commit
6ab3254384
51 files changed
+2951
-3221
No files matched your search
+4
-38
@@ -6,28 +6,22 @@ import { cn } from "@lib/utils"
|
||||
type Props = {
|
||||
tags: string[]
|
||||
data: CollectionEntry<"blog">[] // Simplified to just Astro content for now
|
||||
templates?: string[] // Add template prop
|
||||
}
|
||||
|
||||
export default function Blog({ data, tags, templates = ["default"] }: Props) {
|
||||
export default function Blog({ data, tags }: Props) {
|
||||
const [filter, setFilter] = createSignal(new Set<string>())
|
||||
const [selectedTemplate, setSelectedTemplate] = createSignal<string>("all") // Add template selection
|
||||
const [posts, setPosts] = createSignal<CollectionEntry<"blog">[]>([])
|
||||
|
||||
createEffect(() => {
|
||||
setPosts(data.filter((entry) => {
|
||||
// Filter by tags
|
||||
const tagMatch = Array.from(filter()).every((value) =>
|
||||
entry.data.tags.some((tag:string) =>
|
||||
entry.tags.some((tag:string) =>
|
||||
tag.toLowerCase() === String(value).toLowerCase()
|
||||
)
|
||||
)
|
||||
|
||||
// Filter by template if a specific template is selected
|
||||
const templateMatch = selectedTemplate() === "all" ||
|
||||
(entry.data.template && entry.data.template === selectedTemplate())
|
||||
|
||||
return tagMatch && templateMatch
|
||||
return tagMatch
|
||||
}))
|
||||
})
|
||||
|
||||
@@ -45,34 +39,6 @@ export default function Blog({ data, tags, templates = ["default"] }: Props) {
|
||||
<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>
|
||||
|
||||
{/* Template Filter */}
|
||||
<div class="mb-4">
|
||||
<div class="text-xs uppercase mb-1 text-spaghetti-brown/70">Template</div>
|
||||
<ul class="flex flex-wrap sm:flex-col gap-1.5">
|
||||
<li>
|
||||
<button
|
||||
onClick={() => setSelectedTemplate("all")}
|
||||
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", selectedTemplate() === "all" && "text-spaghetti-brown dark:text-spaghetti-brown")}
|
||||
>
|
||||
All Templates
|
||||
</button>
|
||||
</li>
|
||||
<For each={templates}>
|
||||
{(template) => (
|
||||
<li>
|
||||
<button
|
||||
onClick={() => setSelectedTemplate(template)}
|
||||
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", selectedTemplate() === template && "text-spaghetti-brown dark:text-spaghetti-brown")}
|
||||
>
|
||||
{template.charAt(0).toUpperCase() + template.slice(1)}
|
||||
</button>
|
||||
</li>
|
||||
)}
|
||||
</For>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{/* Tag Filter */}
|
||||
<div class="mb-2">
|
||||
<div class="text-xs uppercase mb-1 text-spaghetti-brown/70">Tags</div>
|
||||
@@ -102,7 +68,7 @@ export default function Blog({ data, tags, templates = ["default"] }: Props) {
|
||||
<ul class="flex flex-col gap-3">
|
||||
{posts().map((post) => (
|
||||
<li>
|
||||
<ArrowCard entry={post} />
|
||||
<ArrowCard entry={post} collection={'blog'} />
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
Reference in new issue
Block a user