diff --git a/src/components/ecosystem-pages/categories-mobile.tsx b/src/components/ecosystem-pages/categories-mobile.tsx index 7a51dce9..1f900da3 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 ( {({ active }) => ( @@ -56,15 +58,33 @@ const Categories = ({ )} + {page === "deployed-on-akash" && ( + + {({ active }) => ( + + Showcase + + )} + + )} + {tags?.map((tag: string) => ( {({ active }) => ( diff --git a/src/components/ecosystem-pages/categories.astro b/src/components/ecosystem-pages/categories.astro index e3ba65c0..efafa2f0 100644 --- a/src/components/ecosystem-pages/categories.astro +++ b/src/components/ecosystem-pages/categories.astro @@ -44,25 +44,39 @@ const displayTag = (tag: string) => {
All + { + astroUrl.pathname.includes("deployed-on-akash") && ( + + Showcase + + ) + } { sortedTags.map((tag: string) => ( ; +const { projects, tags, title } = Astro.props; +const astroUrl = Astro.url; +--- + + + + + + +
+ + +
+
+

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

+ +
+ +
+ { + projects?.map((project: Project, i: number) => { + return ( + + ); + }) + } +
+
+
+
diff --git a/src/components/ecosystem-pages/top-header.astro b/src/components/ecosystem-pages/top-header.astro index b2afc3da..1d2a974b 100644 --- a/src/components/ecosystem-pages/top-header.astro +++ b/src/components/ecosystem-pages/top-header.astro @@ -7,12 +7,10 @@ const pathName = astroUrl.pathname.split("/"); const { tags } = Astro.props; --- -
-

Explore the Akash Ecosystem

- -
+

+ Explore the Akash Ecosystem +

+
diff --git a/src/components/header/popovers/links.tsx b/src/components/header/popovers/links.tsx index 483224b5..67fda398 100644 --- a/src/components/header/popovers/links.tsx +++ b/src/components/header/popovers/links.tsx @@ -4,7 +4,6 @@ import { CalendarHeart, Codesandbox, FileStack, - GraduationCap, HeartHandshake, } from "lucide-react"; @@ -286,12 +285,6 @@ export const networkItems = [ ]; export const ecosystemNavItems = [ - { - icon: GraduationCap, - title: "Showcase", - - link: "/ecosystem/showcase/latest/", - }, { customIcon: ( - ), - title: "Tools", + title: "Deployed on Akash", - link: "/ecosystem/akash-tools/latest/", + link: "/ecosystem/deployed-on-akash/", }, - { customIcon: ( + ), - title: "Deployed on Akash", + title: "Tools", - link: "/ecosystem/deployed-on-akash/latest/", + link: "/ecosystem/akash-tools/", }, + { icon: FileStack, title: "Case Studies", 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/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 new file mode 100644 index 00000000..1b37add6 --- /dev/null +++ b/src/pages/ecosystem/deployed-on-akash/showcase.astro @@ -0,0 +1,39 @@ +--- +import { getCollection, type CollectionEntry } from "astro:content"; + +import EcosystemPage from "@/components/ecosystem-pages/ecosystem-page.astro"; +import { getPriorityIndex } from "@/utils/sequences/deployedOnAkash"; + +type Project = CollectionEntry<"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; + + 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 tags: string[] = Array.from( + new Set( + cards.flatMap((project) => + project.data.tags.map((tag) => tag.toLowerCase()), + ), + ), +); +--- + + 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 ( - - ); - }) - } -
- - -
-
-
diff --git a/src/utils/redirects.ts b/src/utils/redirects.ts index 1a2287a6..0c871132 100644 --- a/src/utils/redirects.ts +++ b/src/utils/redirects.ts @@ -19,4 +19,6 @@ 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/", + "/ecosystem/akash-tools/latest/": "/ecosystem/akash-tools/", }; 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",