From 1df5646f63f56f76ce7d0c8155cab46a47f532c0 Mon Sep 17 00:00:00 2001 From: dharamveergit Date: Fri, 15 Nov 2024 11:23:32 +0530 Subject: [PATCH 1/8] feat: showcase and deployed on akash combined --- .../ecosystem-pages/categories.astro | 14 +++ src/components/header/popovers/links.tsx | 47 ++++----- .../deployed-on-akash/showcase/[page].astro | 96 +++++++++++++++++++ src/utils/redirects.ts | 1 + 4 files changed, 131 insertions(+), 27 deletions(-) create mode 100644 src/pages/ecosystem/deployed-on-akash/showcase/[page].astro diff --git a/src/components/ecosystem-pages/categories.astro b/src/components/ecosystem-pages/categories.astro index e3ba65c0..29cf79a1 100644 --- a/src/components/ecosystem-pages/categories.astro +++ b/src/components/ecosystem-pages/categories.astro @@ -53,6 +53,20 @@ const displayTag = (tag: string) => { > All + { + astroUrl.pathname.includes("deployed-on-akash") && ( + + Showcase + + ) + } { sortedTags.map((tag: string) => ( - ), - title: "Tools", + title: "Deployed on Akash", - link: "/ecosystem/akash-tools/latest/", + link: "/ecosystem/deployed-on-akash/showcase/1", }, - { customIcon: ( + ), - title: "Deployed on Akash", + title: "Tools", - link: "/ecosystem/deployed-on-akash/latest/", + link: "/ecosystem/akash-tools/latest/", }, + { icon: FileStack, title: "Case Studies", diff --git a/src/pages/ecosystem/deployed-on-akash/showcase/[page].astro b/src/pages/ecosystem/deployed-on-akash/showcase/[page].astro new file mode 100644 index 00000000..6121d180 --- /dev/null +++ b/src/pages/ecosystem/deployed-on-akash/showcase/[page].astro @@ -0,0 +1,96 @@ +--- +import ProjectCard from "@/components/ecosystem-pages/project-card.astro"; +import Pagination from "@/components/pagination.astro"; +import Layout from "@/layouts/layout.astro"; +import type { PaginateFunction } from "astro"; +import { getCollection, type CollectionEntry } from "astro:content"; + +import Categories from "@/components/ecosystem-pages/categories.astro"; +import TopHeader from "@/components/ecosystem-pages/top-header.astro"; +import TopMargin from "@/components/ui/top-margin.astro"; +import { getPriorityIndex } from "@/utils/sequences/deployedOnAkash"; + +type Project = CollectionEntry<"Ecosystem_Page">; + +export async function getStaticPaths({ + paginate, +}: { + paginate: PaginateFunction; +}) { + const data = await getCollection("Ecosystem_Page"); + + const sortProjects = (projects: Project[]) => + projects.sort((a, b) => { + const dateDiff = + new Date(b.data.pubDate).getTime() - new Date(a.data.pubDate).getTime(); + const priorityDiff = + getPriorityIndex(a.data.projectTitle) - + getPriorityIndex(b.data.projectTitle); + return dateDiff || priorityDiff; + }); + + const cards = sortProjects( + data.filter((project) => project.data.category === "deployed_on_akash"), + ); + const projects = sortProjects( + data.filter((project) => project.data.showcase === true), + ); + + const tags: string[] = Array.from( + new Set( + cards.flatMap((project) => + project.data.tags.map((tag) => tag.toLowerCase()), + ), + ), + ); + + return paginate(projects, { + props: { tags }, + pageSize: 9, + }); +} + +const { page, tags } = Astro.props; +--- + + + + + + +
+ + +
+

+ Showcase +

+ +
+ { + page?.data?.map((project: Project, i: number) => ( + + )) + } +
+ + +
+
+
diff --git a/src/utils/redirects.ts b/src/utils/redirects.ts index 1a2287a6..a4db7a54 100644 --- a/src/utils/redirects.ts +++ b/src/utils/redirects.ts @@ -19,4 +19,5 @@ export const redirects = { "/about/pricing/custom": "/pricing/usage-calculator/", "/community/insiders/": "/community/akash-insiders/", "/community/core-groups/cg-list/": "/development/current-groups/", + "/ecosystem/showcase/latest/": "/ecosystem/deployed-on-akash/showcase/1", }; From c4a345e9278b3ae00f76057ade07b7aa56fa0d8c Mon Sep 17 00:00:00 2001 From: dharamveergit Date: Fri, 15 Nov 2024 11:25:51 +0530 Subject: [PATCH 2/8] delete: unused showcase pages --- .../showcase/[tag]/latest/[page].astro | 124 -------------- .../showcase/[tag]/oldest/[page].astro | 121 -------------- .../ecosystem/showcase/latest/[...page].astro | 151 ------------------ .../ecosystem/showcase/oldest/[...page].astro | 108 ------------- 4 files changed, 504 deletions(-) delete mode 100644 src/pages/ecosystem/showcase/[tag]/latest/[page].astro delete mode 100644 src/pages/ecosystem/showcase/[tag]/oldest/[page].astro delete mode 100644 src/pages/ecosystem/showcase/latest/[...page].astro delete mode 100644 src/pages/ecosystem/showcase/oldest/[...page].astro diff --git a/src/pages/ecosystem/showcase/[tag]/latest/[page].astro b/src/pages/ecosystem/showcase/[tag]/latest/[page].astro deleted file mode 100644 index 3f46a31d..00000000 --- a/src/pages/ecosystem/showcase/[tag]/latest/[page].astro +++ /dev/null @@ -1,124 +0,0 @@ ---- -import ProjectCard from "@/components/ecosystem-pages/project-card.astro"; -import SortDropDown from "@/components/ecosystem-pages/sort-dropdown"; -import TagsSortDropDown from "@/components/ecosystem-pages/tags-sort-dropdown"; -import Pagination from "@/components/pagination.astro"; -import Layout from "@/layouts/layout.astro"; -import type { PaginateFunction } from "astro"; -import { getCollection, type CollectionEntry } from "astro:content"; - -import Categories from "@/components/ecosystem-pages/categories.astro"; -import TopHeader from "@/components/ecosystem-pages/top-header.astro"; -import TopMargin from "@/components/ui/top-margin.astro"; -type Project = CollectionEntry<"Ecosystem_Page">; - -export async function getStaticPaths({ - paginate, -}: { - paginate: PaginateFunction; -}) { - const projects = (await getCollection("Ecosystem_Page")) - .filter((project) => project.data.showcase === true) - .sort((a, b) => { - const dateA = new Date(a.data.pubDate); - const dateB = new Date(b.data.pubDate); - - return dateB.getTime() - dateA.getTime(); - }); - - const tags: string[] = []; - - projects.forEach((project) => { - project.data.tags.forEach((tag: string) => { - const lowerCasedTag = tag.toLowerCase(); - - if (!tags.includes(lowerCasedTag)) { - tags.push(lowerCasedTag); - } - }); - }); - - return tags.flatMap((tag) => { - const lowercasedTag = tag.toLowerCase(); - - const filteredPosts = projects.filter((post) => - post.data.tags.some((tag: string) => tag.toLowerCase() === lowercasedTag), - ); - - return paginate(filteredPosts, { - params: { tag }, - pageSize: 12, - props: { currentTag: tag, tags: tags }, - }); - }); -} - -const { page, currentTag, tags } = Astro.props; - -const astroUrl = Astro.url; - -const formattedTag = currentTag.charAt(0).toUpperCase() + currentTag.slice(1); ---- - - - - - - -
- - -
-
-

- { - currentTag === "ai & ml" - ? "AI & ML" - : currentTag.charAt(0).toUpperCase() + currentTag.slice(1) - } -

- -
- { - astroUrl.pathname.split("/")[3] === "latest" || - astroUrl.pathname.split("/")[3] === "oldest" ? ( - - ) : ( - - ) - } -
-
- -
- { - page.data.map((project: Project, i: number) => { - return ( - - ); - }) - } -
- - -
-
-
diff --git a/src/pages/ecosystem/showcase/[tag]/oldest/[page].astro b/src/pages/ecosystem/showcase/[tag]/oldest/[page].astro deleted file mode 100644 index 9db75aa9..00000000 --- a/src/pages/ecosystem/showcase/[tag]/oldest/[page].astro +++ /dev/null @@ -1,121 +0,0 @@ ---- -import ProjectCard from "@/components/ecosystem-pages/project-card.astro"; -import SortDropDown from "@/components/ecosystem-pages/sort-dropdown"; -import TagsSortDropDown from "@/components/ecosystem-pages/tags-sort-dropdown"; -import Pagination from "@/components/pagination.astro"; -import Layout from "@/layouts/layout.astro"; -import type { PaginateFunction } from "astro"; -import { getCollection, type CollectionEntry } from "astro:content"; - -import Categories from "@/components/ecosystem-pages/categories.astro"; -import TopHeader from "@/components/ecosystem-pages/top-header.astro"; -import TopMargin from "@/components/ui/top-margin.astro"; -type Project = CollectionEntry<"Ecosystem_Page">; - -export async function getStaticPaths({ - paginate, -}: { - paginate: PaginateFunction; -}) { - const projects = (await getCollection("Ecosystem_Page")) - .filter((project) => project.data.showcase === true) - .sort((a, b) => { - const dateA = new Date(a.data.pubDate); - const dateB = new Date(b.data.pubDate); - - return dateA.getTime() - dateB.getTime(); - }); - - const tags: string[] = []; - - projects.forEach((project) => { - project.data.tags.forEach((tag: string) => { - const lowerCasedTag = tag.toLowerCase(); - - if (!tags.includes(lowerCasedTag)) { - tags.push(lowerCasedTag); - } - }); - }); - - return tags.flatMap((tag) => { - const lowercasedTag = tag.toLowerCase(); - - const filteredPosts = projects.filter((post) => - post.data.tags.some((tag: string) => tag.toLowerCase() === lowercasedTag), - ); - - return paginate(filteredPosts, { - params: { tag }, - pageSize: 12, - props: { currentTag: tag, tags: tags }, - }); - }); -} - -const { page, currentTag, tags } = Astro.props; - -const astroUrl = Astro.url; - -const formattedTag = currentTag.charAt(0).toUpperCase() + currentTag.slice(1); ---- - - - - - - -
- - -
-
-

- { - currentTag === "ai & ml" - ? "AI & ML" - : currentTag.charAt(0).toUpperCase() + currentTag.slice(1) - } -

- -
- { - astroUrl.pathname.split("/")[3] === "latest" || - astroUrl.pathname.split("/")[3] === "oldest" ? ( - - ) : ( - - ) - } -
-
- -
- { - page.data.map((project: Project, i: number) => { - return ( - - ); - }) - } -
- - -
-
-
diff --git a/src/pages/ecosystem/showcase/latest/[...page].astro b/src/pages/ecosystem/showcase/latest/[...page].astro deleted file mode 100644 index 3972c7df..00000000 --- a/src/pages/ecosystem/showcase/latest/[...page].astro +++ /dev/null @@ -1,151 +0,0 @@ ---- -import ProjectCard from "@/components/ecosystem-pages/project-card.astro"; -import SortDropDown from "@/components/ecosystem-pages/sort-dropdown"; -import TagsSortDropDown from "@/components/ecosystem-pages/tags-sort-dropdown"; -import Pagination from "@/components/pagination.astro"; -import Layout from "@/layouts/layout.astro"; -import type { PaginateFunction } from "astro"; -import { getCollection, type CollectionEntry } from "astro:content"; - -import Categories from "@/components/ecosystem-pages/categories.astro"; -import TopHeader from "@/components/ecosystem-pages/top-header.astro"; -import TopMargin from "@/components/ui/top-margin.astro"; -import { getPriorityIndex } from "@/utils/sequences/deployedOnAkash"; -type Project = CollectionEntry<"Ecosystem_Page">; - -// Define a function to generate static paths -export async function getStaticPaths({ - paginate, -}: { - paginate: PaginateFunction; -}) { - // Retrieve the collection of "AkashTools_Page" and sort it by publication date - const projects = (await getCollection("Ecosystem_Page")) - .filter((project) => project.data.showcase === true) - .sort((a, b) => { - const dateA = new Date(a.data.pubDate); - const dateB = new Date(b.data.pubDate); - - // Sort in decending order of date - return ( - dateB.getTime() - dateA.getTime() && - getPriorityIndex(a?.data?.projectTitle) - - getPriorityIndex(b?.data?.projectTitle) - ); - }); - - // Initialize an array to store unique tags - const tags: string[] = []; - - // Loop through each project - projects.forEach((project) => { - // Loop through the tags in each project - project.data.tags.forEach((tag: string) => { - // Capitalize the first letter of the tag and convert it to lowercase - const lowerCasedTag = tag.toLowerCase(); - - // Check if the tag is not already in the 'tags' array - if (!tags.includes(lowerCasedTag)) { - // Add the tag to the 'tags' array - tags.push(lowerCasedTag); - } - }); - }); - - // Paginate the projects and pass the tags as props - return paginate(projects, { - props: { tags: tags }, - pageSize: 9, - }); -} - -// Destructure data from Astro.props -const { page, tags } = Astro.props; - -// Access the current URL from Astro.url -const astroUrl = Astro.url; - -const pathName = astroUrl.pathname.split("/"); ---- - - - - - - - - - - -
- - -
-
-

- {pathName?.[2]?.charAt(0).toUpperCase() + pathName?.[2]?.slice(1)} -

- -
- { - astroUrl.pathname.split("/")[3] === "latest" || - astroUrl.pathname.split("/")[3] === "oldest" ? ( - - ) : ( - - ) - } -
-
- -
- { - page?.data?.map((project: Project, i: number) => { - return ( - - ); - }) - } -
- - -
-
-
diff --git a/src/pages/ecosystem/showcase/oldest/[...page].astro b/src/pages/ecosystem/showcase/oldest/[...page].astro deleted file mode 100644 index 2e2cd835..00000000 --- a/src/pages/ecosystem/showcase/oldest/[...page].astro +++ /dev/null @@ -1,108 +0,0 @@ ---- -import ProjectCard from "@/components/ecosystem-pages/project-card.astro"; -import SortDropDown from "@/components/ecosystem-pages/sort-dropdown"; -import TagsSortDropDown from "@/components/ecosystem-pages/tags-sort-dropdown"; -import Pagination from "@/components/pagination.astro"; -import Layout from "@/layouts/layout.astro"; -import type { PaginateFunction } from "astro"; -import { getCollection, type CollectionEntry } from "astro:content"; - -import Categories from "@/components/ecosystem-pages/categories.astro"; -import TopHeader from "@/components/ecosystem-pages/top-header.astro"; -import TopMargin from "@/components/ui/top-margin.astro"; -type Project = CollectionEntry<"Ecosystem_Page">; - -export async function getStaticPaths({ - paginate, -}: { - paginate: PaginateFunction; -}) { - const projects = (await getCollection("Ecosystem_Page")) - .filter((project) => project.data.showcase === true) - .sort((a, b) => { - const dateA = new Date(a.data.pubDate); - const dateB = new Date(b.data.pubDate); - - return dateA.getTime() - dateB.getTime(); - }); - - const tags: string[] = []; - - projects.forEach((project) => { - project.data.tags.forEach((tag: string) => { - const lowerCasedTag = tag.toLowerCase(); - - if (!tags.includes(lowerCasedTag)) { - tags.push(lowerCasedTag); - } - }); - }); - - return paginate(projects, { - props: { tags: tags }, - pageSize: 9, - }); -} - -const { page, tags } = Astro.props; - -const astroUrl = Astro.url; - -const pathName = astroUrl.pathname.split("/"); ---- - - - - - - -
- - -
-
-

- {pathName?.[2]?.charAt(0).toUpperCase() + pathName?.[2]?.slice(1)} -

- -
- { - astroUrl.pathname.split("/")[3] === "latest" || - astroUrl.pathname.split("/")[3] === "oldest" ? ( - - ) : ( - - ) - } -
-
- -
- { - page.data.map((project: Project, i: number) => { - return ( - - ); - }) - } -
- - -
-
-
From 04a0cbb4e2c51a49951a7b3e3c345ff4bf094b2e Mon Sep 17 00:00:00 2001 From: dharamveergit Date: Fri, 15 Nov 2024 11:31:58 +0530 Subject: [PATCH 3/8] fix: showcase sort --- .../ecosystem/deployed-on-akash/showcase/[page].astro | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pages/ecosystem/deployed-on-akash/showcase/[page].astro b/src/pages/ecosystem/deployed-on-akash/showcase/[page].astro index 6121d180..95670f3a 100644 --- a/src/pages/ecosystem/deployed-on-akash/showcase/[page].astro +++ b/src/pages/ecosystem/deployed-on-akash/showcase/[page].astro @@ -21,12 +21,14 @@ export async function getStaticPaths({ const sortProjects = (projects: Project[]) => projects.sort((a, b) => { - const dateDiff = - new Date(b.data.pubDate).getTime() - new Date(a.data.pubDate).getTime(); const priorityDiff = getPriorityIndex(a.data.projectTitle) - getPriorityIndex(b.data.projectTitle); - return dateDiff || priorityDiff; + if (priorityDiff !== 0) return priorityDiff; + + return ( + new Date(b.data.pubDate).getTime() - new Date(a.data.pubDate).getTime() + ); }); const cards = sortProjects( @@ -49,7 +51,6 @@ export async function getStaticPaths({ pageSize: 9, }); } - const { page, tags } = Astro.props; --- From ee9cade9a68743b94381892b3d0fc506c1bdc1af Mon Sep 17 00:00:00 2001 From: dharamveergit Date: Fri, 15 Nov 2024 12:03:02 +0530 Subject: [PATCH 4/8] fix: removed showcase pagination and Morpheus resort --- .../ecosystem-pages/categories-mobile.tsx | 24 ++++++- src/components/header/popovers/links.tsx | 2 +- src/content/Ecosystem_Page/morpheus/index.md | 2 +- .../{showcase/[page].astro => showcase.astro} | 66 +++++++------------ src/utils/redirects.ts | 2 +- src/utils/sequences/deployedOnAkash.ts | 1 + 6 files changed, 51 insertions(+), 46 deletions(-) rename src/pages/ecosystem/deployed-on-akash/{showcase/[page].astro => showcase.astro} (57%) diff --git a/src/components/ecosystem-pages/categories-mobile.tsx b/src/components/ecosystem-pages/categories-mobile.tsx index 7a51dce9..f30d0f96 100644 --- a/src/components/ecosystem-pages/categories-mobile.tsx +++ b/src/components/ecosystem-pages/categories-mobile.tsx @@ -15,6 +15,8 @@ const Categories = ({ page: string; className?: string; }) => { + console.log(page); + return (
@@ -56,6 +58,24 @@ const Categories = ({ )} + {page === "deployed-on-akash" && ( + + {({ active }) => ( + + Showcase + + )} + + )} + {tags?.map((tag: string) => ( {({ active }) => ( @@ -64,7 +84,7 @@ const Categories = ({ className={classNames( active ? "bg-gray-100 text-foreground dark:bg-darkGray" - : "text-[#687076]", + : "text-para", "block px-4 py-2 text-sm", )} > diff --git a/src/components/header/popovers/links.tsx b/src/components/header/popovers/links.tsx index 377c58be..db0fd90e 100644 --- a/src/components/header/popovers/links.tsx +++ b/src/components/header/popovers/links.tsx @@ -333,7 +333,7 @@ export const ecosystemNavItems = [ ), title: "Deployed on Akash", - link: "/ecosystem/deployed-on-akash/showcase/1", + link: "/ecosystem/deployed-on-akash/showcase/", }, { customIcon: ( diff --git a/src/content/Ecosystem_Page/morpheus/index.md b/src/content/Ecosystem_Page/morpheus/index.md index e01f7ecb..170d33ce 100644 --- a/src/content/Ecosystem_Page/morpheus/index.md +++ b/src/content/Ecosystem_Page/morpheus/index.md @@ -2,7 +2,7 @@ projectTitle: Morpheus projectImage: "./project-banner.png" pubDate: "2024-05-08" -showcase: false +showcase: true tags: - AI & ML diff --git a/src/pages/ecosystem/deployed-on-akash/showcase/[page].astro b/src/pages/ecosystem/deployed-on-akash/showcase.astro similarity index 57% rename from src/pages/ecosystem/deployed-on-akash/showcase/[page].astro rename to src/pages/ecosystem/deployed-on-akash/showcase.astro index 95670f3a..82d9b1ce 100644 --- a/src/pages/ecosystem/deployed-on-akash/showcase/[page].astro +++ b/src/pages/ecosystem/deployed-on-akash/showcase.astro @@ -1,8 +1,6 @@ --- import ProjectCard from "@/components/ecosystem-pages/project-card.astro"; -import Pagination from "@/components/pagination.astro"; import Layout from "@/layouts/layout.astro"; -import type { PaginateFunction } from "astro"; import { getCollection, type CollectionEntry } from "astro:content"; import Categories from "@/components/ecosystem-pages/categories.astro"; @@ -12,51 +10,39 @@ import { getPriorityIndex } from "@/utils/sequences/deployedOnAkash"; type Project = CollectionEntry<"Ecosystem_Page">; -export async function getStaticPaths({ - paginate, -}: { - paginate: PaginateFunction; -}) { - const data = await getCollection("Ecosystem_Page"); +const data = await getCollection("Ecosystem_Page"); - const sortProjects = (projects: Project[]) => - projects.sort((a, b) => { - const priorityDiff = - getPriorityIndex(a.data.projectTitle) - - getPriorityIndex(b.data.projectTitle); - if (priorityDiff !== 0) return priorityDiff; +const sortProjects = (projects: Project[]) => + projects.sort((a, b) => { + const priorityDiff = + getPriorityIndex(a.data.projectTitle) - + getPriorityIndex(b.data.projectTitle); + if (priorityDiff !== 0) return priorityDiff; - return ( - new Date(b.data.pubDate).getTime() - new Date(a.data.pubDate).getTime() - ); - }); + return ( + new Date(b.data.pubDate).getTime() - new Date(a.data.pubDate).getTime() + ); + }); - const cards = sortProjects( - data.filter((project) => project.data.category === "deployed_on_akash"), - ); - const projects = sortProjects( - data.filter((project) => project.data.showcase === true), - ); +const cards = sortProjects( + data.filter((project) => project.data.category === "deployed_on_akash"), +); +const projects = sortProjects( + data.filter((project) => project.data.showcase === true), +); - const tags: string[] = Array.from( - new Set( - cards.flatMap((project) => - project.data.tags.map((tag) => tag.toLowerCase()), - ), +const tags: string[] = Array.from( + new Set( + cards.flatMap((project) => + project.data.tags.map((tag) => tag.toLowerCase()), ), - ); - - return paginate(projects, { - props: { tags }, - pageSize: 9, - }); -} -const { page, tags } = Astro.props; + ), +); --- - +
{ - page?.data?.map((project: Project, i: number) => ( + projects?.map((project: Project, i: number) => ( - -
diff --git a/src/utils/redirects.ts b/src/utils/redirects.ts index a4db7a54..347fc926 100644 --- a/src/utils/redirects.ts +++ b/src/utils/redirects.ts @@ -19,5 +19,5 @@ export const redirects = { "/about/pricing/custom": "/pricing/usage-calculator/", "/community/insiders/": "/community/akash-insiders/", "/community/core-groups/cg-list/": "/development/current-groups/", - "/ecosystem/showcase/latest/": "/ecosystem/deployed-on-akash/showcase/1", + "/ecosystem/showcase/latest/": "/ecosystem/deployed-on-akash/showcase/", }; diff --git a/src/utils/sequences/deployedOnAkash.ts b/src/utils/sequences/deployedOnAkash.ts index 932c371d..3c1ddf29 100644 --- a/src/utils/sequences/deployedOnAkash.ts +++ b/src/utils/sequences/deployedOnAkash.ts @@ -4,6 +4,7 @@ export const deployedOnAkash = [ "Prime Intellect", "University of Texas at Austin", "Nous Research", + "Morpheus", "Flock.io", "Akash Chat API", "Akash Chat", From 481108e530f48b16325bb8a3e4b8541db1717933 Mon Sep 17 00:00:00 2001 From: dharamveergit Date: Fri, 15 Nov 2024 13:10:26 +0530 Subject: [PATCH 5/8] feat: remove pagination --- .../ecosystem-pages/categories-mobile.tsx | 6 +- .../ecosystem-pages/categories.astro | 18 +- .../ecosystem-pages/ecosystem-page.astro | 55 ++++++ src/components/header/popovers/links.tsx | 2 +- .../ecosystem/akash-tools/[tag]/index.astro | 47 +++++ .../akash-tools/[tag]/latest/[page].astro | 137 --------------- .../akash-tools/[tag]/oldest/[page].astro | 163 ------------------ src/pages/ecosystem/akash-tools/index.astro | 28 +++ .../akash-tools/latest/[...page].astro | 106 ------------ .../akash-tools/oldest/[...page].astro | 152 ---------------- .../deployed-on-akash/[tag]/index.astro | 57 ++++++ .../[tag]/latest/[page].astro | 124 ------------- .../[tag]/oldest/[page].astro | 124 ------------- .../ecosystem/deployed-on-akash/index.astro | 33 ++++ .../deployed-on-akash/latest/[...page].astro | 111 ------------ .../deployed-on-akash/oldest/[...page].astro | 106 ------------ .../deployed-on-akash/showcase.astro | 46 +---- 17 files changed, 235 insertions(+), 1080 deletions(-) create mode 100644 src/components/ecosystem-pages/ecosystem-page.astro create mode 100644 src/pages/ecosystem/akash-tools/[tag]/index.astro delete mode 100644 src/pages/ecosystem/akash-tools/[tag]/latest/[page].astro delete mode 100644 src/pages/ecosystem/akash-tools/[tag]/oldest/[page].astro create mode 100644 src/pages/ecosystem/akash-tools/index.astro delete mode 100644 src/pages/ecosystem/akash-tools/latest/[...page].astro delete mode 100644 src/pages/ecosystem/akash-tools/oldest/[...page].astro create mode 100644 src/pages/ecosystem/deployed-on-akash/[tag]/index.astro delete mode 100644 src/pages/ecosystem/deployed-on-akash/[tag]/latest/[page].astro delete mode 100644 src/pages/ecosystem/deployed-on-akash/[tag]/oldest/[page].astro create mode 100644 src/pages/ecosystem/deployed-on-akash/index.astro delete mode 100644 src/pages/ecosystem/deployed-on-akash/latest/[...page].astro delete mode 100644 src/pages/ecosystem/deployed-on-akash/oldest/[...page].astro diff --git a/src/components/ecosystem-pages/categories-mobile.tsx b/src/components/ecosystem-pages/categories-mobile.tsx index f30d0f96..1f900da3 100644 --- a/src/components/ecosystem-pages/categories-mobile.tsx +++ b/src/components/ecosystem-pages/categories-mobile.tsx @@ -46,7 +46,7 @@ const Categories = ({ {({ active }) => ( {({ active }) => ( {({ active }) => ( {
{ { astroUrl.pathname.includes("deployed-on-akash") && ( { { sortedTags.map((tag: string) => ( ; +const { projects, tags, title } = Astro.props; +--- + + + + + + +
+ + +
+

+ {title || "Deployed On Akash"} +

+ +
+ { + projects?.map((project: Project, i: number) => { + return ( + + ); + }) + } +
+
+
+
diff --git a/src/components/header/popovers/links.tsx b/src/components/header/popovers/links.tsx index db0fd90e..0f73fd30 100644 --- a/src/components/header/popovers/links.tsx +++ b/src/components/header/popovers/links.tsx @@ -388,7 +388,7 @@ export const ecosystemNavItems = [ ), title: "Tools", - link: "/ecosystem/akash-tools/latest/", + link: "/ecosystem/akash-tools", }, { diff --git a/src/pages/ecosystem/akash-tools/[tag]/index.astro b/src/pages/ecosystem/akash-tools/[tag]/index.astro new file mode 100644 index 00000000..5c069918 --- /dev/null +++ b/src/pages/ecosystem/akash-tools/[tag]/index.astro @@ -0,0 +1,47 @@ +--- +import { getCollection } from "astro:content"; + +import EcosystemPage from "@/components/ecosystem-pages/ecosystem-page.astro"; + +export async function getStaticPaths() { + const projects = (await getCollection("Ecosystem_Page")) + .filter((project) => project.data.category === "tool") + .sort((a, b) => { + const dateA = new Date(a.data.pubDate); + const dateB = new Date(b.data.pubDate); + + return dateB.getTime() - dateA.getTime(); + }); + + const tags: string[] = []; + + projects.forEach((project) => { + project.data.tags.forEach((tag: string) => { + const lowerCasedTag = tag.toLowerCase(); + if (!tags.includes(lowerCasedTag)) { + tags.push(lowerCasedTag); + } + }); + }); + + return tags.flatMap((tag) => { + const lowercasedTag = tag.toLowerCase(); + + const filteredPosts = projects.filter((post) => + post.data.tags.some((tag: string) => tag.toLowerCase() === lowercasedTag), + ); + + return { + params: { tag }, + + props: { currentTag: tag, tags: tags, page: filteredPosts }, + }; + }); +} + +const { page, currentTag, tags } = Astro.props; + +const formattedTag = currentTag.charAt(0).toUpperCase() + currentTag.slice(1); +--- + + diff --git a/src/pages/ecosystem/akash-tools/[tag]/latest/[page].astro b/src/pages/ecosystem/akash-tools/[tag]/latest/[page].astro deleted file mode 100644 index fa82a0d0..00000000 --- a/src/pages/ecosystem/akash-tools/[tag]/latest/[page].astro +++ /dev/null @@ -1,137 +0,0 @@ ---- -import Layout from "@/layouts/layout.astro"; -import type { PaginateFunction } from "astro"; -import { getCollection, type CollectionEntry } from "astro:content"; - -import ProjectCard from "@/components/ecosystem-pages/project-card.astro"; -import Pagination from "@/components/pagination.astro"; - -import SortDropDown from "@/components/ecosystem-pages/sort-dropdown"; -import TagsSortDropDown from "@/components/ecosystem-pages/tags-sort-dropdown"; - -import Categories from "@/components/ecosystem-pages/categories.astro"; -import TopHeader from "@/components/ecosystem-pages/top-header.astro"; -import TopMargin from "@/components/ui/top-margin.astro"; -// Define the data structure for a project -type Project = CollectionEntry<"Ecosystem_Page">; - -// Define a function to generate static paths -export async function getStaticPaths({ - paginate, -}: { - paginate: PaginateFunction; -}) { - // Retrieve the collection of "AkashTools_Page" and sort it by publication date - const projects = (await getCollection("Ecosystem_Page")) - .filter((project) => project.data.category === "tool") - .sort((a, b) => { - const dateA = new Date(a.data.pubDate); - const dateB = new Date(b.data.pubDate); - - // Sort in descending order (latest date first) - return dateB.getTime() - dateA.getTime(); - }); - - // Initialize an array to store unique tags - const tags: string[] = []; - - // Loop through each project - projects.forEach((project) => { - // Loop through the tags in each blog post - project.data.tags.forEach((tag: string) => { - // Capitalize the first letter of the tag - const lowerCasedTag = tag.toLowerCase(); - // Check if the tag is not already in the allTags array - if (!tags.includes(lowerCasedTag)) { - // Add the tag to the allTags array - tags.push(lowerCasedTag); - } - }); - }); - - // Generate paths for each tag - return tags.flatMap((tag) => { - const lowercasedTag = tag.toLowerCase(); - - // filter posts related to specified tag - const filteredPosts = projects.filter((post) => - post.data.tags.some((tag: string) => tag.toLowerCase() === lowercasedTag), - ); - - return paginate(filteredPosts, { - params: { tag }, - pageSize: 12, - props: { currentTag: tag, tags: tags }, - }); - }); -} - -// Destructure data from Astro.props -const { page, currentTag, tags } = Astro.props; - -// Access the current URL from Astro.url -const astroUrl = Astro.url; -const pathName = astroUrl.pathname.split("/"); - -// Convert the first letter to uppercase -const formattedTag = currentTag.charAt(0).toUpperCase() + currentTag.slice(1); ---- - - - - - - -
- - -
-
-

- {currentTag} -

- -
- { - astroUrl.pathname.split("/")[3] === "latest" || - astroUrl.pathname.split("/")[3] === "oldest" ? ( - - ) : ( - - ) - } -
-
- -
- { - page.data.map((project: Project, i: number) => { - return ( - - ); - }) - } -
- - -
-
-
diff --git a/src/pages/ecosystem/akash-tools/[tag]/oldest/[page].astro b/src/pages/ecosystem/akash-tools/[tag]/oldest/[page].astro deleted file mode 100644 index 78f2a740..00000000 --- a/src/pages/ecosystem/akash-tools/[tag]/oldest/[page].astro +++ /dev/null @@ -1,163 +0,0 @@ ---- -import { getCollection, type CollectionEntry } from "astro:content"; -import type { PaginateFunction } from "astro"; -import Layout from "@/layouts/layout.astro"; -import Tag from "@/components/ui/tag.astro"; -import Pagination from "@/components/pagination.astro"; -import ProjectCard from "@/components/ecosystem-pages/project-card.astro"; -import EcosystemNavbar from "@/components/ecosystem-pages/ecosystem-navbar.astro"; -import { SortActions } from "@/components/ecosystem-pages/sort-actions"; -import SortDropDown from "@/components/ecosystem-pages/sort-dropdown"; -import TagsSortDropDown from "@/components/ecosystem-pages/tags-sort-dropdown"; -import SearchDialog from "@/components/ecosystem-pages/search-dialog"; - -import TopMargin from "@/components/ui/top-margin.astro"; -import TopHeader from "@/components/ecosystem-pages/top-header.astro"; -import Categories from "@/components/ecosystem-pages/categories.astro"; -type Project = CollectionEntry<"Ecosystem_Page">; - -// Define a function to generate static paths -export async function getStaticPaths({ - paginate, -}: { - paginate: PaginateFunction; -}) { - // Retrieve the collection of "AkashTools_Page" and sort it by publication date - const projects = (await getCollection("Ecosystem_Page")) - .filter((project) => project.data.category === "tool") - .sort((a, b) => { - const dateA = new Date(a.data.pubDate); - const dateB = new Date(b.data.pubDate); - - // Sort in descending order (latest date first) - return dateA.getTime() - dateB.getTime(); - }); - - // Initialize an array to store unique tags - const tags: string[] = []; - - // Loop through each project - projects.forEach((project) => { - // Loop through the tags in each blog post - project.data.tags.forEach((tag: string) => { - // Capitalize the first letter of the tag - const lowerCasedTag = tag.toLowerCase(); - // Check if the tag is not already in the allTags array - if (!tags.includes(lowerCasedTag)) { - // Add the tag to the allTags array - tags.push(lowerCasedTag); - } - }); - }); - - // Generate paths for each tag - return tags.flatMap((tag) => { - const lowercasedTag = tag.toLowerCase(); - - // filter posts related to specified tag - const filteredPosts = projects.filter((post) => - post.data.tags.some((tag: string) => tag.toLowerCase() === lowercasedTag), - ); - - return paginate(filteredPosts, { - params: { tag }, - pageSize: 12, - props: { currentTag: tag, tags: tags }, - }); - }); -} - -// Destructure data from Astro.props -const { page, currentTag, tags } = Astro.props; - -// Access the current URL from Astro.url -const astroUrl = Astro.url; -const pathName = astroUrl.pathname.split("/"); - -const formattedTag = currentTag.charAt(0).toUpperCase() + currentTag.slice(1); ---- - - - - - - - - - - -
- - -
-
-

- {currentTag} -

- -
- { - astroUrl.pathname.split("/")[3] === "latest" || - astroUrl.pathname.split("/")[3] === "oldest" ? ( - - ) : ( - - ) - } -
-
- -
- { - page.data.map((project: Project, i: number) => { - return ( - - ); - }) - } -
- - -
-
-
diff --git a/src/pages/ecosystem/akash-tools/index.astro b/src/pages/ecosystem/akash-tools/index.astro new file mode 100644 index 00000000..bbc7bcb2 --- /dev/null +++ b/src/pages/ecosystem/akash-tools/index.astro @@ -0,0 +1,28 @@ +--- +import { getCollection } from "astro:content"; + +import EcosystemPage from "@/components/ecosystem-pages/ecosystem-page.astro"; + +const projects = (await getCollection("Ecosystem_Page")) + .filter((project) => project.data.category === "tool") + .sort((a, b) => { + const dateA = new Date(a.data.pubDate); + const dateB = new Date(b.data.pubDate); + + return dateB.getTime() - dateA.getTime(); + }); + +const tags: string[] = []; + +projects.forEach((project) => { + project.data.tags.forEach((tag: string) => { + const lowerCasedTag = tag.toLowerCase(); + + if (!tags.includes(lowerCasedTag)) { + tags.push(lowerCasedTag); + } + }); +}); +--- + + diff --git a/src/pages/ecosystem/akash-tools/latest/[...page].astro b/src/pages/ecosystem/akash-tools/latest/[...page].astro deleted file mode 100644 index 8b9d186c..00000000 --- a/src/pages/ecosystem/akash-tools/latest/[...page].astro +++ /dev/null @@ -1,106 +0,0 @@ ---- -import ProjectCard from "@/components/ecosystem-pages/project-card.astro"; -import SortDropDown from "@/components/ecosystem-pages/sort-dropdown"; -import TagsSortDropDown from "@/components/ecosystem-pages/tags-sort-dropdown"; -import Pagination from "@/components/pagination.astro"; -import Layout from "@/layouts/layout.astro"; -import type { PaginateFunction } from "astro"; -import { getCollection, type CollectionEntry } from "astro:content"; - -import Categories from "@/components/ecosystem-pages/categories.astro"; -import TopHeader from "@/components/ecosystem-pages/top-header.astro"; -import TopMargin from "@/components/ui/top-margin.astro"; -type Project = CollectionEntry<"Ecosystem_Page">; - -export async function getStaticPaths({ - paginate, -}: { - paginate: PaginateFunction; -}) { - const projects = (await getCollection("Ecosystem_Page")) - .filter((project) => project.data.category === "tool") - .sort((a, b) => { - const dateA = new Date(a.data.pubDate); - const dateB = new Date(b.data.pubDate); - - return dateB.getTime() - dateA.getTime(); - }); - - const tags: string[] = []; - - projects.forEach((project) => { - project.data.tags.forEach((tag: string) => { - const lowerCasedTag = tag.toLowerCase(); - - if (!tags.includes(lowerCasedTag)) { - tags.push(lowerCasedTag); - } - }); - }); - - return paginate(projects, { - props: { tags: tags }, - pageSize: 9, - }); -} - -const { page, tags } = Astro.props; - -const astroUrl = Astro.url; ---- - - - - - - -
- - -
-
-

- Tools -

- -
- { - astroUrl.pathname.split("/")[3] === "latest" || - astroUrl.pathname.split("/")[3] === "oldest" ? ( - - ) : ( - - ) - } -
-
- -
- { - page.data.map((project: Project, i: number) => { - return ( - - ); - }) - } -
- - -
-
-
diff --git a/src/pages/ecosystem/akash-tools/oldest/[...page].astro b/src/pages/ecosystem/akash-tools/oldest/[...page].astro deleted file mode 100644 index c1e250f3..00000000 --- a/src/pages/ecosystem/akash-tools/oldest/[...page].astro +++ /dev/null @@ -1,152 +0,0 @@ ---- -import Layout from "@/layouts/layout.astro"; -import ProjectCard from "@/components/ecosystem-pages/project-card.astro"; -import { SortActions } from "../../../../components/ecosystem-pages/sort-actions"; -import Pagination from "@/components/pagination.astro"; -import Tag from "@/components/ui/tag.astro"; -import { Image } from "astro:assets"; -import ChevronRight from "@/assets/chevron-right.svg"; -import { getCollection, type CollectionEntry } from "astro:content"; -import type { PaginateFunction } from "astro"; -import EcosystemNavbar from "@/components/ecosystem-pages/ecosystem-navbar.astro"; -import SortDropDown from "@/components/ecosystem-pages/sort-dropdown"; -import TagsSortDropDown from "@/components/ecosystem-pages/tags-sort-dropdown"; -import SearchDialog from "@/components/ecosystem-pages/search-dialog"; - -import TopMargin from "@/components/ui/top-margin.astro"; -import TopHeader from "@/components/ecosystem-pages/top-header.astro"; -import Categories from "@/components/ecosystem-pages/categories.astro"; -type Project = CollectionEntry<"Ecosystem_Page">; - -// Define a function to generate static paths -export async function getStaticPaths({ - paginate, -}: { - paginate: PaginateFunction; -}) { - // Retrieve the collection of "AkashTools_Page" and sort it by publication date - const projects = (await getCollection("Ecosystem_Page")) - .filter((project) => project.data.category === "tool") - .sort((a, b) => { - const dateA = new Date(a.data.pubDate); - const dateB = new Date(b.data.pubDate); - - // Sort in ascending order of date - return dateA.getTime() - dateB.getTime(); - }); - - // Initialize an array to store unique tags - const tags: string[] = []; - - // Loop through each project - projects.forEach((project) => { - // Loop through the tags in each project - project.data.tags.forEach((tag: string) => { - // Capitalize the first letter of the tag and convert it to lowercase - const lowerCasedTag = tag.toLowerCase(); - - // Check if the tag is not already in the 'tags' array - if (!tags.includes(lowerCasedTag)) { - // Add the tag to the 'tags' array - tags.push(lowerCasedTag); - } - }); - }); - - // Paginate the projects and pass the tags as props - return paginate(projects, { - props: { tags: tags }, - pageSize: 9, - }); -} - -// Destructure data from Astro.props -const { page, tags } = Astro.props; - -// Access the current URL from Astro.url -const astroUrl = Astro.url; - -const pathName = astroUrl.pathname.split("/"); ---- - - - - - - - - - - -
- - -
-
-

- Tools -

- -
- { - astroUrl.pathname.split("/")[3] === "latest" || - astroUrl.pathname.split("/")[3] === "oldest" ? ( - - ) : ( - - ) - } -
-
- -
- { - page.data.map((project: Project, i: number) => { - return ( - - ); - }) - } -
- - -
-
-
diff --git a/src/pages/ecosystem/deployed-on-akash/[tag]/index.astro b/src/pages/ecosystem/deployed-on-akash/[tag]/index.astro new file mode 100644 index 00000000..2749140f --- /dev/null +++ b/src/pages/ecosystem/deployed-on-akash/[tag]/index.astro @@ -0,0 +1,57 @@ +--- +import EcosystemPage from "@/components/ecosystem-pages/ecosystem-page.astro"; +import { getPriorityIndex } from "@/utils/sequences/deployedOnAkash"; +import { getCollection, type CollectionEntry } from "astro:content"; +type Project = CollectionEntry<"Ecosystem_Page">; + +export async function getStaticPaths() { + const projects = (await getCollection("Ecosystem_Page")) + .filter((project) => project.data.category === "deployed_on_akash") + .sort((a, b) => { + const dateA = new Date(a.data.pubDate); + const dateB = new Date(b.data.pubDate); + return ( + dateB.getTime() - dateA.getTime() && + getPriorityIndex(a.data.projectTitle) - + getPriorityIndex(b.data.projectTitle) + ); + }); + + const tags: string[] = []; + + projects.forEach((project) => { + project.data.tags.forEach((tag: string) => { + const lowerCasedTag = tag.toLowerCase(); + if (!tags.includes(lowerCasedTag)) { + tags.push(lowerCasedTag); + } + }); + }); + + return tags.flatMap((tag) => { + const lowercasedTag = tag.toLowerCase(); + const filteredPosts = projects.filter((post) => + post.data.tags.some((tag: string) => tag.toLowerCase() === lowercasedTag), + ); + + return { + params: { tag }, + + props: { currentTag: tag, tags: tags, page: filteredPosts }, + }; + }); +} + +const { page, currentTag, tags } = Astro.props; +const astroUrl = Astro.url; +const pathName = astroUrl.pathname.split("/"); +const formattedTag = currentTag.charAt(0).toUpperCase() + currentTag.slice(1); +--- + + diff --git a/src/pages/ecosystem/deployed-on-akash/[tag]/latest/[page].astro b/src/pages/ecosystem/deployed-on-akash/[tag]/latest/[page].astro deleted file mode 100644 index 3865aa4e..00000000 --- a/src/pages/ecosystem/deployed-on-akash/[tag]/latest/[page].astro +++ /dev/null @@ -1,124 +0,0 @@ ---- -import Categories from "@/components/ecosystem-pages/categories.astro"; -import ProjectCard from "@/components/ecosystem-pages/project-card.astro"; -import SortDropDown from "@/components/ecosystem-pages/sort-dropdown"; -import TagsSortDropDown from "@/components/ecosystem-pages/tags-sort-dropdown"; -import TopHeader from "@/components/ecosystem-pages/top-header.astro"; -import Pagination from "@/components/pagination.astro"; -import TopMargin from "@/components/ui/top-margin.astro"; -import Layout from "@/layouts/layout.astro"; -import { getPriorityIndex } from "@/utils/sequences/deployedOnAkash"; -import type { PaginateFunction } from "astro"; -import { getCollection, type CollectionEntry } from "astro:content"; -type Project = CollectionEntry<"Ecosystem_Page">; - -export async function getStaticPaths({ - paginate, -}: { - paginate: PaginateFunction; -}) { - const projects = (await getCollection("Ecosystem_Page")) - .filter((project) => project.data.category === "deployed_on_akash") - .sort((a, b) => { - const dateA = new Date(a.data.pubDate); - const dateB = new Date(b.data.pubDate); - return ( - dateB.getTime() - dateA.getTime() && - getPriorityIndex(a.data.projectTitle) - - getPriorityIndex(b.data.projectTitle) - ); - }); - - const tags: string[] = []; - - projects.forEach((project) => { - project.data.tags.forEach((tag: string) => { - const lowerCasedTag = tag.toLowerCase(); - if (!tags.includes(lowerCasedTag)) { - tags.push(lowerCasedTag); - } - }); - }); - - return tags.flatMap((tag) => { - const lowercasedTag = tag.toLowerCase(); - const filteredPosts = projects.filter((post) => - post.data.tags.some((tag: string) => tag.toLowerCase() === lowercasedTag), - ); - - return paginate(filteredPosts, { - params: { tag }, - pageSize: 12, - props: { currentTag: tag, tags: tags }, - }); - }); -} - -const { page, currentTag, tags } = Astro.props; -const astroUrl = Astro.url; -const pathName = astroUrl.pathname.split("/"); -const formattedTag = currentTag.charAt(0).toUpperCase() + currentTag.slice(1); ---- - - - - - - -
- - -
-
-

- { - currentTag === "ai & ml" - ? "AI & ML" - : currentTag.charAt(0).toUpperCase() + currentTag.slice(1) - } -

- -
- { - astroUrl.pathname.split("/")[3] === "latest" || - astroUrl.pathname.split("/")[3] === "oldest" ? ( - - ) : ( - - ) - } -
-
- -
- { - page.data.map((project: Project, i: number) => { - return ( - - ); - }) - } -
- - -
-
-
diff --git a/src/pages/ecosystem/deployed-on-akash/[tag]/oldest/[page].astro b/src/pages/ecosystem/deployed-on-akash/[tag]/oldest/[page].astro deleted file mode 100644 index abf1c9c1..00000000 --- a/src/pages/ecosystem/deployed-on-akash/[tag]/oldest/[page].astro +++ /dev/null @@ -1,124 +0,0 @@ ---- -import ProjectCard from "@/components/ecosystem-pages/project-card.astro"; -import SortDropDown from "@/components/ecosystem-pages/sort-dropdown"; -import TagsSortDropDown from "@/components/ecosystem-pages/tags-sort-dropdown"; -import Pagination from "@/components/pagination.astro"; -import Layout from "@/layouts/layout.astro"; -import type { PaginateFunction } from "astro"; -import { getCollection, type CollectionEntry } from "astro:content"; - -import Categories from "@/components/ecosystem-pages/categories.astro"; -import TopHeader from "@/components/ecosystem-pages/top-header.astro"; -import TopMargin from "@/components/ui/top-margin.astro"; -type Project = CollectionEntry<"Ecosystem_Page">; - -export async function getStaticPaths({ - paginate, -}: { - paginate: PaginateFunction; -}) { - const projects = (await getCollection("Ecosystem_Page")) - .filter((project) => project.data.category === "deployed_on_akash") - .sort((a, b) => { - const dateA = new Date(a.data.pubDate); - const dateB = new Date(b.data.pubDate); - - return dateA.getTime() - dateB.getTime(); - }); - - const tags: string[] = []; - - projects.forEach((project) => { - project.data.tags.forEach((tag: string) => { - const lowerCasedTag = tag.toLowerCase(); - - if (!tags.includes(lowerCasedTag)) { - tags.push(lowerCasedTag); - } - }); - }); - - return tags.flatMap((tag) => { - const lowercasedTag = tag.toLowerCase(); - - const filteredPosts = projects.filter((post) => - post.data.tags.some((tag: string) => tag.toLowerCase() === lowercasedTag), - ); - - return paginate(filteredPosts, { - params: { tag }, - pageSize: 12, - props: { currentTag: tag, tags: tags }, - }); - }); -} - -const { page, currentTag, tags } = Astro.props; - -const astroUrl = Astro.url; - -const formattedTag = currentTag.charAt(0).toUpperCase() + currentTag.slice(1); ---- - - - - - - -
- - -
-
-

- { - currentTag === "ai & ml" - ? "AI & ML" - : currentTag.charAt(0).toUpperCase() + currentTag.slice(1) - } -

- -
- { - astroUrl.pathname.split("/")[3] === "latest" || - astroUrl.pathname.split("/")[3] === "oldest" ? ( - - ) : ( - - ) - } -
-
- -
- { - page.data.map((project: Project, i: number) => { - return ( - - ); - }) - } -
- - -
-
-
diff --git a/src/pages/ecosystem/deployed-on-akash/index.astro b/src/pages/ecosystem/deployed-on-akash/index.astro new file mode 100644 index 00000000..8afaf38b --- /dev/null +++ b/src/pages/ecosystem/deployed-on-akash/index.astro @@ -0,0 +1,33 @@ +--- +import { getCollection } from "astro:content"; + +import EcosystemPage from "@/components/ecosystem-pages/ecosystem-page.astro"; +import { getPriorityIndex } from "@/utils/sequences/deployedOnAkash"; + +const projects = (await getCollection("Ecosystem_Page")) + .filter((project) => project.data.category === "deployed_on_akash") + .sort((a, b) => { + const dateA = new Date(a.data.pubDate); + const dateB = new Date(b.data.pubDate); + + return ( + dateB.getTime() - dateA.getTime() && + getPriorityIndex(a.data.projectTitle) - + getPriorityIndex(b.data.projectTitle) + ); + }); + +const tags: string[] = []; + +projects.forEach((project) => { + project.data.tags.forEach((tag: any) => { + const lowerCasedTag = tag.toLowerCase(); + + if (!tags.includes(lowerCasedTag)) { + tags.push(lowerCasedTag); + } + }); +}); +--- + + diff --git a/src/pages/ecosystem/deployed-on-akash/latest/[...page].astro b/src/pages/ecosystem/deployed-on-akash/latest/[...page].astro deleted file mode 100644 index bc7a234a..00000000 --- a/src/pages/ecosystem/deployed-on-akash/latest/[...page].astro +++ /dev/null @@ -1,111 +0,0 @@ ---- -import ProjectCard from "@/components/ecosystem-pages/project-card.astro"; -import SortDropDown from "@/components/ecosystem-pages/sort-dropdown"; -import TagsSortDropDown from "@/components/ecosystem-pages/tags-sort-dropdown"; -import Pagination from "@/components/pagination.astro"; -import Layout from "@/layouts/layout.astro"; -import type { PaginateFunction } from "astro"; -import { getCollection, type CollectionEntry } from "astro:content"; - -import Categories from "@/components/ecosystem-pages/categories.astro"; -import TopHeader from "@/components/ecosystem-pages/top-header.astro"; -import TopMargin from "@/components/ui/top-margin.astro"; -import { getPriorityIndex } from "@/utils/sequences/deployedOnAkash"; - -type Project = CollectionEntry<"Ecosystem_Page">; - -export async function getStaticPaths({ - paginate, -}: { - paginate: PaginateFunction; -}) { - const projects = (await getCollection("Ecosystem_Page")) - .filter((project) => project.data.category === "deployed_on_akash") - .sort((a, b) => { - const dateA = new Date(a.data.pubDate); - const dateB = new Date(b.data.pubDate); - - return ( - dateB.getTime() - dateA.getTime() && - getPriorityIndex(a.data.projectTitle) - - getPriorityIndex(b.data.projectTitle) - ); - }); - - const tags: string[] = []; - - projects.forEach((project) => { - project.data.tags.forEach((tag: any) => { - const lowerCasedTag = tag.toLowerCase(); - - if (!tags.includes(lowerCasedTag)) { - tags.push(lowerCasedTag); - } - }); - }); - - return paginate(projects, { - props: { tags: tags }, - pageSize: 9, - }); -} - -const { page, tags } = Astro.props; -const astroUrl = Astro.url; ---- - - - - - - -
- - -
-
-

- Deployed On Akash -

- -
- { - astroUrl.pathname.split("/")[3] === "latest" || - astroUrl.pathname.split("/")[3] === "oldest" ? ( - - ) : ( - - ) - } -
-
- -
- { - page.data?.map((project: Project, i: number) => { - return ( - - ); - }) - } -
- - -
-
-
diff --git a/src/pages/ecosystem/deployed-on-akash/oldest/[...page].astro b/src/pages/ecosystem/deployed-on-akash/oldest/[...page].astro deleted file mode 100644 index b998f33d..00000000 --- a/src/pages/ecosystem/deployed-on-akash/oldest/[...page].astro +++ /dev/null @@ -1,106 +0,0 @@ ---- -import ProjectCard from "@/components/ecosystem-pages/project-card.astro"; -import SortDropDown from "@/components/ecosystem-pages/sort-dropdown"; -import TagsSortDropDown from "@/components/ecosystem-pages/tags-sort-dropdown"; -import Pagination from "@/components/pagination.astro"; -import Layout from "@/layouts/layout.astro"; -import type { PaginateFunction } from "astro"; -import { getCollection, type CollectionEntry } from "astro:content"; - -import Categories from "@/components/ecosystem-pages/categories.astro"; -import TopHeader from "@/components/ecosystem-pages/top-header.astro"; -import TopMargin from "@/components/ui/top-margin.astro"; - -type Project = CollectionEntry<"Ecosystem_Page">; - -export async function getStaticPaths({ - paginate, -}: { - paginate: PaginateFunction; -}) { - const projects = (await getCollection("Ecosystem_Page")) - .filter((project) => project.data.category === "deployed_on_akash") - .sort((a, b) => { - const dateA = new Date(a.data.pubDate); - const dateB = new Date(b.data.pubDate); - - return dateA.getTime() - dateB.getTime(); - }); - - const tags: string[] = []; - - projects.forEach((project) => { - project.data.tags.forEach((tag: string) => { - const lowerCasedTag = tag.toLowerCase(); - - if (!tags.includes(lowerCasedTag)) { - tags.push(lowerCasedTag); - } - }); - }); - - return paginate(projects, { - props: { tags: tags }, - pageSize: 9, - }); -} - -const { page, tags } = Astro.props; -const astroUrl = Astro.url; ---- - - - - - - -
- - -
-
-

- Deployed -

- -
- { - astroUrl.pathname.split("/")[3] === "latest" || - astroUrl.pathname.split("/")[3] === "oldest" ? ( - - ) : ( - - ) - } -
-
- -
- { - page.data.map((project: Project, i: number) => { - return ( - - ); - }) - } -
- - -
-
-
diff --git a/src/pages/ecosystem/deployed-on-akash/showcase.astro b/src/pages/ecosystem/deployed-on-akash/showcase.astro index 82d9b1ce..1b37add6 100644 --- a/src/pages/ecosystem/deployed-on-akash/showcase.astro +++ b/src/pages/ecosystem/deployed-on-akash/showcase.astro @@ -1,11 +1,7 @@ --- -import ProjectCard from "@/components/ecosystem-pages/project-card.astro"; -import Layout from "@/layouts/layout.astro"; import { getCollection, type CollectionEntry } from "astro:content"; -import Categories from "@/components/ecosystem-pages/categories.astro"; -import TopHeader from "@/components/ecosystem-pages/top-header.astro"; -import TopMargin from "@/components/ui/top-margin.astro"; +import EcosystemPage from "@/components/ecosystem-pages/ecosystem-page.astro"; import { getPriorityIndex } from "@/utils/sequences/deployedOnAkash"; type Project = CollectionEntry<"Ecosystem_Page">; @@ -40,42 +36,4 @@ const tags: string[] = Array.from( ); --- - - - - - -
- - -
-

- Showcase -

- -
- { - projects?.map((project: Project, i: number) => ( - - )) - } -
-
-
-
+ From c9adabced97665fc0cdf6eae81b957fb0c92c774 Mon Sep 17 00:00:00 2001 From: dharamveergit Date: Fri, 15 Nov 2024 13:11:22 +0530 Subject: [PATCH 6/8] update redirects.ts --- src/utils/redirects.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils/redirects.ts b/src/utils/redirects.ts index 347fc926..0c871132 100644 --- a/src/utils/redirects.ts +++ b/src/utils/redirects.ts @@ -20,4 +20,5 @@ export const redirects = { "/community/insiders/": "/community/akash-insiders/", "/community/core-groups/cg-list/": "/development/current-groups/", "/ecosystem/showcase/latest/": "/ecosystem/deployed-on-akash/showcase/", + "/ecosystem/akash-tools/latest/": "/ecosystem/akash-tools/", }; From 1291d6ec666f94ca05ff812463cc7c0547010d4b Mon Sep 17 00:00:00 2001 From: dharamveergit Date: Fri, 15 Nov 2024 17:14:55 +0530 Subject: [PATCH 7/8] update categories.astro, ecosystem-page.astro and top-header.astro --- .../ecosystem-pages/categories.astro | 6 +++--- .../ecosystem-pages/ecosystem-page.astro | 19 +++++++++++++------ .../ecosystem-pages/top-header.astro | 10 ++++------ 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/components/ecosystem-pages/categories.astro b/src/components/ecosystem-pages/categories.astro index f9af27f9..4040fa77 100644 --- a/src/components/ecosystem-pages/categories.astro +++ b/src/components/ecosystem-pages/categories.astro @@ -45,7 +45,7 @@ const displayTag = (tag: string) => {