diff --git a/components/v4/particles/dummyData/dummyData.js b/components/v4/particles/dummyData/dummyData.js
index 9bbd8523..cad19751 100644
--- a/components/v4/particles/dummyData/dummyData.js
+++ b/components/v4/particles/dummyData/dummyData.js
@@ -7,7 +7,7 @@ export const dummyData =
},
{
src:'/static/particles/topics/box.png',
- slug:'/posts/ui/page/1',
+ slug:'/topic/ui/page/1',
position:{x:50, y:26},
topic:true
},
@@ -33,7 +33,7 @@ export const dummyData =
},
{
src:'/static/particles/topics/accessibility.png',
- slug:'/posts/accessibility/page/1',
+ slug:'/topic/accessibility/page/1',
position:{x:70, y:25},
topic:true
},
@@ -50,7 +50,7 @@ export const dummyData =
{
src:'/static/particles/topics/swatches.png',
- slug:'/posts/branding/page/1',
+ slug:'/topic/branding/page/1',
position:{x:76, y:89},
topic:true
},
@@ -76,7 +76,7 @@ export const dummyData =
},
{
src:'/static/particles/topics/arrow.png',
- slug:'/posts/product-design/page/1',
+ slug:'/topic/product-design/page/1',
position:{x:59, y:42},
topic:true
},
@@ -92,7 +92,7 @@ export const dummyData =
},
{
src:'/static/particles/topics/ai.png',
- slug:'/posts/ai/page/1',
+ slug:'/topic/ai/page/1',
position:{x:88, y:6},
topic:true
},
@@ -104,7 +104,7 @@ export const dummyData =
},
{
src:'/static/particles/topics/github.png',
- slug:'/posts/open-source/page/1',
+ slug:'/topic/open-source/page/1',
position:{x:98, y:60},
topic:true
},
@@ -116,7 +116,7 @@ export const dummyData =
},
{
src:'/static/particles/topics/localization.png',
- slug:'/posts/localization/page/1',
+ slug:'/topic/localization/page/1',
position:{x:55, y:69},
topic:true
},
@@ -128,7 +128,7 @@ export const dummyData =
},
{
src:'/static/particles/topics/twitter.png',
- slug:'/posts/social-media/page/1',
+ slug:'/topic/social-media/page/1',
position:{x:78, y:48},
topic:true
},
@@ -144,7 +144,7 @@ export const dummyData =
},
{
src:'/static/particles/topics/brain.png',
- slug:'/posts/behavioural-design/page/1',
+ slug:'/topic/behavioural-design/page/1',
position:{x:45, y:56},
topic:true
},
diff --git a/components/v4/particles/dummyData/dummyDataB.js b/components/v4/particles/dummyData/dummyDataB.js
index f33a0ffb..12482ee6 100644
--- a/components/v4/particles/dummyData/dummyDataB.js
+++ b/components/v4/particles/dummyData/dummyDataB.js
@@ -14,7 +14,7 @@ export const dummyData =
},
{
src:'/static/particles/topics/plain/box.png',
- slug:'/posts/ui/page/1',
+ slug:'/topic/ui/page/1',
position:{x:0, y:66},
topic:true,
size:{min:16, max:18},
@@ -66,7 +66,7 @@ export const dummyData =
},
{
src:'/static/particles/topics/plain/accessibility.png',
- slug:'/posts/accessibility/page/1',
+ slug:'/topic/accessibility/page/1',
position:{x:20, y:70},
topic:true,
size:{min:16, max:18},
@@ -97,7 +97,7 @@ export const dummyData =
{
src:'/static/particles/topics/plain/swatches.png',
- slug:'/posts/branding/page/1',
+ slug:'/topic/branding/page/1',
position:{x:66, y:79},
topic:true,
size:{min:16, max:18},
@@ -124,7 +124,7 @@ export const dummyData =
},
{
src:'/static/particles/topics/plain/arrow.png',
- slug:'/posts/product-design/page/1',
+ slug:'/topic/product-design/page/1',
position:{x:45, y:44},
topic:true,
size:{min:16, max:18},
@@ -141,7 +141,7 @@ export const dummyData =
},
{
src:'/static/particles/topics/plain/ai.png',
- slug:'/posts/ai/page/1',
+ slug:'/topic/ai/page/1',
size:{min:16, max:18},
position:{x:84, y:10},
topic:true
@@ -154,7 +154,7 @@ export const dummyData =
},
{
src:'/static/particles/topics/plain/github.png',
- slug:'/posts/open-source/page/1',
+ slug:'/topic/open-source/page/1',
position:{x:98, y:60},
topic:true,
size:{min:16, max:18},
@@ -167,7 +167,7 @@ export const dummyData =
},
{
src:'/static/particles/topics/plain/localization.png',
- slug:'/posts/localization/page/1',
+ slug:'/topic/localization/page/1',
position:{x:40, y:69},
topic:true,
size:{min:16, max:18},
@@ -180,7 +180,7 @@ export const dummyData =
},
// {
// src:'/static/particles/topics/plain/twitter.png',
- // slug:'/posts/social-media/page/1',
+ // slug:'/topic/social-media/page/1',
// position:{x:68, y:48},
// topic:true
// },
@@ -196,7 +196,7 @@ export const dummyData =
},
{
src:'/static/particles/topics/plain/brain.png',
- slug:'/posts/behavioural-design/page/1',
+ slug:'/topic/behavioural-design/page/1',
position:{x:25, y:46},
topic:true,
size:{min:16, max:18},
diff --git a/components/v4/section/PostSectionHeroWithNews.js b/components/v4/section/PostSectionHeroWithNews.js
new file mode 100644
index 00000000..9f5746f1
--- /dev/null
+++ b/components/v4/section/PostSectionHeroWithNews.js
@@ -0,0 +1,138 @@
+// import SidebarDiscover from "@/components/v4/layout/SidebarDiscover";
+import Container from "@/components/container";
+// import PostsGridHero from "@/components/v4/layout/PostsGridHero";
+import SectionDivider from "./SectionDivider";
+import HeroPostGrid from "../layout/HeroPostGrid";
+// import NewsColumn from "../layout/NewsColumn";
+import PostsNewsGroup3 from "../layout/PostNewsGroup3";
+
+import { FireIcon } from "@/components/icons";
+
+const PostsSectionHeroWithNews = ({
+ user,
+ heroCardPost,
+ toolsList,
+ showHeroTitle,
+ groupSlice,
+ viewablePosts,
+ showTags,
+ title,
+ showRecent,
+ showTitle,
+ news,
+ headline,
+ groupedNewsPosts,
+ tagName,
+ tools,
+ pageNo,
+ tag,
+}) => {
+ return (
+
+ {showRecent ? (
+ <>
+ {/* */}
+
+
+ {/*
*/}
+ {/*
*/}
+
+ {/* */}
+
+
+ {/*
*/}
+ {/* */}
+
+
+
+ >
+ ) : (
+
+
+
+ {showTitle !== false && (
+
+ {/* */}
+
+ )}
+
+
+
+ {tagName} News
+
+ }
+ news={news}
+ tag={tag}
+ tagName={tagName}
+ groupedNewsPosts={groupedNewsPosts}
+ tools={tools}
+ />
+
+ {/*
*/}
+
+ )}
+
+ {/* {showTags &&
+
+
+
+ } */}
+
+ );
+};
+
+export default PostsSectionHeroWithNews;
diff --git a/components/v4/section/PostsSectionHero.js b/components/v4/section/PostsSectionHero.js
index c968c8a4..1fc6b9bb 100644
--- a/components/v4/section/PostsSectionHero.js
+++ b/components/v4/section/PostsSectionHero.js
@@ -5,34 +5,58 @@ import PostsGroup3Cards from "../layout/PostsGroup3Cards";
import SectionDivider from "./SectionDivider";
import HeroPostGrid from "../layout/HeroPostGrid";
-const PostsSectionHero = ({user, heroCardPost,toolsList,showHeroTitle,groupSlice, viewablePosts, showTags,title, showRecent,showTitle }) => {
+const PostsSectionHero = ({
+ user,
+ heroCardPost,
+ toolsList,
+ showHeroTitle,
+ groupSlice,
+ viewablePosts,
+ showTags,
+ title,
+ showRecent,
+ showTitle,
+}) => {
return (
- {showRecent ?
- <>
- {/* */}
-
-
- {/*
*/}
- {/*
*/}
-
- {/* */}
-
-
-
-
-
- {/*
+ {/* */}
+
+
+ {/*
*/}
+ {/*
*/}
+
+ {/* */}
+
-
- {/*
+
+ {/* */}
- {/* */}
+ {/* */}
-
-
- >
- :
-
-
-
-
- {showTitle!==false &&
-
- {/* */}
-
- }
+
+
+ >
+ ) : (
+
+
+
+ {showTitle !== false && (
+
+ {/* */}
+
+ )}
-
-
- {/*
+
+ {/*
*/}
-
- }
-
+
+ )}
- {/* {showTags &&
+ {/* {showTags &&
} */}
-
);
};
diff --git a/components/v4/section/TagsNavRow.js b/components/v4/section/TagsNavRow.js
index 17198034..c2b1c2f9 100644
--- a/components/v4/section/TagsNavRow.js
+++ b/components/v4/section/TagsNavRow.js
@@ -3,79 +3,79 @@ import GiantTag from "../tag/GiantTag";
import {Compass} from '@/components/icons'
import { useEffect, useState } from "react";
-const tags = [
+const tags = (path)=>[
{
name: "Accessibility",
- link: "/posts/accessibility/page/1",
+ link: `/${path?path:'topic'}/accessibility/page/1`,
slug:"accessibility"
},
{
name: "AI",
- link: "/posts/ai/page/1",
+ link: `/${path?path:'topic'}/ai/page/1`,
slug:"ai"
},
{
name: "Branding",
- link: "/posts/branding/page/1",
+ link: `/${path?path:'topic'}/branding/page/1`,
slug:"branding"
},
{
name: "Figma",
- link: "/posts/figma/page/1",
+ link: `/${path?path:'topic'}/figma/page/1`,
slug:"figma"
},
{
name: "Notion",
- link: "/posts/notion/page/1",
+ link: `/${path?path:'topic'}/notion/page/1`,
slug:"notion"
},
{
name: "Interview",
- link: "/posts/interview/page/1",
+ link: `/${path?path:'topic'}/interview/page/1`,
slug:"interview"
},
{
name: "Open Source",
- link: "/posts/open-source/page/1",
+ link: `/${path?path:'topic'}/open-source/page/1`,
slug:"open-source"
},
{
name: "Psychology",
- link: "/posts/design-psychology/page/1",
+ link: `/${path?path:'topic'}/design-psychology/page/1`,
slug:"psychology"
},
{
name: "UI",
- link: "/posts/ui/page/1",
+ link: `/${path?path:'topic'}/ui/page/1`,
slug:"ui"
},
{
name: "UX",
- link: "/posts/ux/page/1",
+ link: `/${path?path:'topic'}/ux/page/1`,
slug:"ux"
},
{
name: "User Research",
- link: "/posts/user-research/page/1",
+ link: `/${path?path:'topic'}/user-research/page/1`,
slug:"user-research"
},
// {
// name: "Web Monetization",
- // link: "/posts/web-monetization/page/1",
+ // link: `/${path?path:'topic'}/web-monetization/page/1`,
// },
{
name: "Career",
- link: "/posts/career/page/1",
+ link: `/${path?path:'topic'}/career/page/1`,
slug:"career"
},
];
-const TagsNavRow = ({currentPage, activeTag}) => {
+const TagsNavRow = ({currentPage, activeTag, path}) => {
- const [orderedTags, setOrderedTags] = useState(tags)
+ const [orderedTags, setOrderedTags] = useState(()=>tags(path))
useEffect(()=>{
- let reordered = orderTags(tags, activeTag)
+ let reordered = orderTags(tags(path), activeTag, path)
setOrderedTags(reordered)
},[activeTag, currentPage])
@@ -99,7 +99,7 @@ const TagsNavRow = ({currentPage, activeTag}) => {
export default TagsNavRow;
//function to order the tags array with the active tag first
-const orderTags = (tags, activeTag) => {
+const orderTags = (tags, activeTag, path) => {
let taglies = [...tags]
if(!activeTag) return tags;
let activeTagIndex = taglies.findIndex((tag) => tag?.slug == activeTag);
@@ -108,7 +108,7 @@ const orderTags = (tags, activeTag) => {
//create tag if it doesn't exist in the tags array
if(!activeTagObject){
const name = activeTag.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
- activeTagObject = {name:name, link:`/posts/${activeTag}/page/1`, slug:activeTag}
+ activeTagObject = {name:name, link:`/${path?path:'topic'}/${activeTag}/page/1`, slug:activeTag}
}
taglies.splice(activeTagIndex, 1);
taglies.unshift(activeTagObject);
diff --git a/components/v4/section/TopicIndexSection.js b/components/v4/section/TopicIndexSection.js
index 462912a2..5b0ba7d1 100644
--- a/components/v4/section/TopicIndexSection.js
+++ b/components/v4/section/TopicIndexSection.js
@@ -34,7 +34,7 @@ const TopicIndexSection = ({index,user, heroCardPost, viewablePosts, jobsSidebar
- See all
+ See all
diff --git a/components/v4/tag/GiantTag.js b/components/v4/tag/GiantTag.js
index 987490cd..4b6a6c91 100644
--- a/components/v4/tag/GiantTag.js
+++ b/components/v4/tag/GiantTag.js
@@ -13,7 +13,7 @@ const GiantTag = ({ link, children, index, active, classes }) => {
+ )}
+ >
+ )}
+
+
{
+ onPageNumChange(pageNum);
+ }}
+ />
+
+ {/* */}
+
+ {/* 5?allPosts.slice(6,allPosts.length):false}
+ paginationComponent={ {
+ onPageNumChange(pageNum, tag);
+ }}
+ />}
+ // heroJob={heroJob}
+ // sponsors={sponsors}
+ toolsList={tools?.slice(0, 4)}
+ // authorsList={topicRes[topic.slug]?.authors}
+ /> */}
+
+ ) : (
+ ""
+ )}
+ {/* todo show loading state above */}
+
+
+
+ >
+ );
+}
+
+// const Sidebar = ({ relatedPosts, paddingTop, author }) => {
+// const [stickyPaddingTop, setStickyPaddingTop] = useState("pt-0");
+
+// const _handleWaypointEnter = () => {
+// setStickyPaddingTop("pt-0");
+// };
+// const _handleWaypointLeave = () => {
+// setStickyPaddingTop(SIDEBAR_STICKY_OFFSET);
+// };
+
+// return (
+//
+//
+//
+//
+//
+//
+// );
+// };
+
+export async function getStaticProps({ preview = null, params, locale }) {
+ let sort = ["featured:desc", "tier:asc", "date:desc"];
+ if (locale === "es-ES") {
+ sort = ["esES:desc", "featured:desc", "tier:asc", "date:desc"];
+ }
+ let pageSize = PAGE_SIZE;
+ const { pageNo, tag } = params;
+
+ let allPosts =
+ (await getPostsByPageForPostsPage(
+ preview,
+ pageSize,
+ pageNo,
+ [tag],
+ sort
+ )) || [];
+
+ let tags = allPosts[1];
+ allPosts = allPosts[0];
+ const pagination = allPosts.meta.pagination;
+
+ let nextPosts = [],
+ morePosts = [],
+ heroPost = null;
+
+ allPosts = transformPostList(allPosts.data, locale);
+
+ const topicToolsRes =
+ (await getCommonQuery(null, [tag], "tool", 4, (pageNo - 1) * 4, [
+ "date:desc",
+ ])) || [];
+ const newsRes =
+ (await getCommonQuery(null, [tag], "bite", 6, (pageNo - 1) * 6, [
+ "date:desc",
+ ])) || [];
+
+ const authors = makeAuthorList(allPosts);
+ shuffleArray(authors);
+
+ // otherwise, just send back the list without splicing
+ // firstPost = allPosts.slice(0, 1);
+ // morePosts = allPosts.slice(1);
+
+ //add blurhash to allPosts images
+ for (var x = 0; x < allPosts.length; x++) {
+ allPosts[x].attributes.base64 = createB64WithFallback(
+ allPosts[x]?.attributes?.featuredImage?.data?.attributes?.blurhash
+ );
+ }
+
+ morePosts = allPosts;
+
+ nextPosts = allPosts;
+
+ const formattedNews = formatAllTools({ tools: newsRes.data, tagNumber: 0 });
+
+ let groupedNewsPosts = groupPostsByDate(formattedNews);
+
+ const { navSponsor, sponsors } = await getSponsors();
+
+ return {
+ props: {
+ allPosts: nextPosts,
+ navSponsor,
+ sponsors: sponsors?.length ? sponsors : [],
+ preview,
+ pagination,
+ tag,
+ tagName: tags?.data[0]?.attributes?.name,
+ pageNo,
+ morePosts,
+ heroPost,
+ news: formattedNews,
+ tools: topicToolsRes?.data,
+ authors: authors,
+ groupedNewsPosts,
+ },
+ revalidate: 20,
+ };
+
+ // const interviews =
+ // (await getCommonQuery(preview, [tag], "article", 4, 0)) || [];
+
+ // console.log("interview data from home***********" + JSON.stringify(interviews))
+}
+
+export async function getStaticPaths() {
+ let pageCountArr = [];
+
+ for (var z = 0; z < ALL_TAGS.length; z++) {
+ const allPosts =
+ (await getAllPostsForPostsPage(null, PAGE_SIZE, 0, [ALL_TAGS[z]])) || [];
+
+ const pagination = allPosts.meta.pagination;
+ const pageCount = pagination.pageCount;
+ let arr = new Array(pageCount).fill("");
+ let newArr = arr.map((i, index) => {
+ return `/topic/${ALL_TAGS[z]}/page/${index + 1}`;
+ });
+ pageCountArr = pageCountArr.concat(newArr);
+ }
+
+ return {
+ paths: pageCountArr || [],
+ fallback: true,
+ };
+}
diff --git a/pages/topics.js b/pages/topics.js
index a404ed63..115e4e72 100644
--- a/pages/topics.js
+++ b/pages/topics.js
@@ -28,7 +28,7 @@ import getSponsors from "@/lib/utils/getSponsors";
const featuredSections = [
{
image: "/static/images/hola.png",
- slug: "/posts/localization/page/1",
+ slug: "/topic/localization/page/1",
class: "bg-gray-50",
title: "Localization",
description:
@@ -36,7 +36,7 @@ const featuredSections = [
},
{
image: "/static/images/wm.png",
- slug: "/posts/web-monetization/page/1",
+ slug: "/topic/web-monetization/page/1",
class: "bg-gray-50",
title: "Web Monetization",
description: "A new way to send money on the web with micropayments.",