Skip to content

Commit

Permalink
sitemap limit increased
Browse files Browse the repository at this point in the history
  • Loading branch information
SH20RAJ authored Mar 22, 2024
1 parent 3451964 commit 30d6653
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/app/sitemap2/[id]/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ console.log(randomNumber);
let getArticlesFromDevTo = async (params) => {
console.log(params);
const response = await fetch(
`https://dev.to/api/articles/latest/?per_page=1000&page=${randomNumber}`
`https://dev.to/api/articles/latest/?per_page=100000&page=${randomNumber}`
);
const data = await response.json();
return data;
Expand All @@ -34,7 +34,7 @@ export async function GET(req) {
// Add each article URL to the sitemap
articles.forEach((article) => {
xml += '<url>';
xml += `<loc>https://dev-art.vercel.app${article.path}</loc>`; // Modify URL structure as needed
xml += `<loc>https://dev.sh20raj.com${article.path}</loc>`; // Modify URL structure as needed
xml += `<lastmod>${new Date(article.published_at).toISOString()}</lastmod>`; // Use published date as last modified
xml += '<changefreq>weekly</changefreq>'; // You can adjust the change frequency
xml += '<priority>0.8</priority>'; // Priority can be adjusted based on the importance of the page
Expand Down
2 changes: 1 addition & 1 deletion src/app/sitemap2/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { NextResponse } from "next/server";
// Mock function to fetch articles (replace this with your actual implementation)
let getArticlesFromDevTo = async () => {
const response = await fetch(
`https://dev.to/api/articles/latest/?per_page=100&page=1`
`https://dev.to/api/articles/latest/?per_page=100000&page=1`
);
const data = await response.json();
return data;
Expand Down

0 comments on commit 30d6653

Please sign in to comment.