Skip to content

Commit

Permalink
Merge pull request #340 from kindlyman343423/For-ecosystem-page-some-…
Browse files Browse the repository at this point in the history
…updates

fix: fix the title of orgs, remove gradient and ordering on Deployed on Akash
  • Loading branch information
HoomanDgtl authored Aug 22, 2024
2 parents e735715 + 5c313d2 commit d0291e5
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 94 deletions.
20 changes: 14 additions & 6 deletions src/components/ecosystem-pages/categories.astro
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,19 @@ const sortedTags = [
...normalizedTags.filter(tag => tag !== "ai & ml").sort((a, b) => a.localeCompare(b)),
];
// Function to display "AI & ML" in proper casing
const displayTag = (tag) => tag === "ai & ml" ? "AI & ML" : tag
.split(" ")
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
.join(" ");
// Function to display specific tags in proper casing or modify others appropriately
const displayTag = (tag) => {
const specialCases = {
"dao": "DAO",
"pos validator": "PoS Validator",
"ai & ml": "AI & ML"
};
return specialCases[tag.toLowerCase()] || tag
.split(" ")
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
.join(" ");
}
---

<div class="hidden w-[200px] flex-shrink-0 pt-5 lg:block">
Expand Down Expand Up @@ -77,4 +85,4 @@ const displayTag = (tag) => tag === "ai & ml" ? "AI & ML" : tag
</div>
)
}
</div>
</div>
2 changes: 1 addition & 1 deletion src/content/Ecosystem_Page/akash-chat-api/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
projectTitle: Akash Chat - API
projectTitle: Akash Chat API
projectImage: "./project-banner.png"
pubDate: "2024-07-29"

Expand Down
20 changes: 0 additions & 20 deletions src/content/Ecosystem_Page/moultrie-audits/index.md

This file was deleted.

Binary file not shown.
2 changes: 1 addition & 1 deletion src/content/Ecosystem_Page/nousresearch/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
projectTitle: Nousresearch
projectTitle: Nous Research
projectImage: "./project-banner.png"
pubDate: "2023-03-04"

Expand Down
2 changes: 1 addition & 1 deletion src/content/Ecosystem_Page/primeIntellect/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
projectTitle: PrimeIntellect AI
projectTitle: Prime Intellect
projectImage: "./project-banner.png"
pubDate: "2024-02-23"

Expand Down
Binary file modified src/content/Ecosystem_Page/primeIntellect/project-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 0 additions & 20 deletions src/content/Ecosystem_Page/spheron/index.md

This file was deleted.

Binary file not shown.
2 changes: 1 addition & 1 deletion src/content/Ecosystem_Page/texas-edu/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
projectTitle: Texas-edu
projectTitle: University of Texas at Austin
projectImage: "./project-banner.png"
pubDate: "2023-11-01"

Expand Down
2 changes: 1 addition & 1 deletion src/content/Ecosystem_Page/venice.ai/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
projectTitle: Venice AI
projectTitle: Venice.ai
projectImage: "./project-banner.png"
pubDate: "2024-07-18"

Expand Down
64 changes: 21 additions & 43 deletions src/pages/ecosystem/deployed-on-akash/[tag]/latest/[page].astro
Original file line number Diff line number Diff line change
Expand Up @@ -17,44 +17,50 @@ import Categories from "@/components/ecosystem-pages/categories.astro";
type Project = CollectionEntry<"Ecosystem_Page">;
// Define a function to generate static paths
const priorityTitles = [
"Brev.dev",
"Venice.ai",
"Prime Intellect",
"University of Texas at Austin",
"Nous Research",
"Flock.io",
"Akash Chat API",
"Akash Chat",
"Auki"
];
// Function to get the index of a project based on the priority list
function getPriorityIndex(title) {
const index = priorityTitles.indexOf(title);
return index === -1 ? priorityTitles.length : index; // If not found, place it at the end
}
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 === "deployed_on_akash")
.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),
);
Expand All @@ -67,13 +73,9 @@ export async function getStaticPaths({
});
}
// 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);
---

Expand All @@ -85,32 +87,6 @@ const formattedTag = currentTag.charAt(0).toUpperCase() + currentTag.slice(1);
<TopHeader tags={tags} />
</TopMargin>

<!-- <div class="container">
<div class="mt-10 hidden gap-x-5 overflow-x-auto md:flex lg:hidden">
{
tags
.sort(() => Math.random() - 0.5)
.map((tag: string) => (
<Tag href={`/ecosystem/deployed-on-akash/${tag.toLowerCase()}/latest/1`}>
{tag.charAt(0).toUpperCase() + tag.slice(1)}
</Tag>
))
}
</div>
</div> -->

<!-- <div class="container mt-10 flex gap-x-5 overflow-x-auto md:hidden">
{
tags
.sort(() => Math.random() - 0.5)
.map((tag: string) => (
<Tag href={`/ecosystem/deployed-on-akash/${tag.toLowerCase()}/latest/1`}>
{tag.charAt(0).toUpperCase() + tag.slice(1)}
</Tag>
))
}
</div> -->

<div
class="container mt-10 flex justify-between lg:gap-x-[20px] xl:gap-x-[48px]"
>
Expand Down Expand Up @@ -144,7 +120,9 @@ const formattedTag = currentTag.charAt(0).toUpperCase() + currentTag.slice(1);
class="mt-4 grid flex-shrink-0 grid-cols-1 gap-y-[24px] sm:grid-cols-2 sm:gap-x-8 md:gap-y-8 lg:grid-cols-3 lg:gap-x-[36px] lg:gap-y-[32px]"
>
{
page.data.map((project: Project, i: number) => {
[...page.data].sort((a, b) =>
getPriorityIndex(a.data.projectTitle) - getPriorityIndex(b.data.projectTitle)
).map((project: Project, i: number) => {
return (
<ProjectCard
title={project.data.projectTitle}
Expand Down

0 comments on commit d0291e5

Please sign in to comment.