diff --git a/src/app/api/sitemap/page.js b/src/app/api/sitemap/page.js new file mode 100644 index 0000000..ba95075 --- /dev/null +++ b/src/app/api/sitemap/page.js @@ -0,0 +1,56 @@ +export function generateRandomNumber(min, max) { + // Math.random() generates a random number between 0 and 1 + // We multiply it by (max - min + 1) to include the max value, + // then add min to ensure the number falls within the desired range. + return Math.floor(Math.random() * (max - min + 1)) + min; +} + +export default async () => { + + const response2 = await fetch( + `https://dev.to/api/articles?per_page=10000` + ); + + const data22 = await response2.json(); + let filteredArticles2 = await data22; + // console.log(data2) + + return ( + <> +
+
+ {await filteredArticles2.map((article) => ( + + ))} +
+ +
+ {/*
+ {await filteredArticles2.map((article) => ( + + {" "} + . + + ))} +
*/} + + + ); +}; + +function ArticleCard({ article }) { + return ( + + {/* Image */} +
{article.title}
+
+

{article.tag_list.join(", ")}

+
+ ); +} diff --git a/src/app/globals.css b/src/app/globals.css index a6da7af..d9df5bd 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -106,6 +106,7 @@ main { margin-right: 10px; overflow-x: hidden; height: fit-content; + min-width: 55%; } blockquote { background: var(--bbg);