You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.2 KiB

  1. // next-sitemap.config.js
  2. module.exports = {
  3. siteUrl: 'https://duasapp.com', // Replace with your site's URL
  4. generateRobotsTxt: true, // Generates robots.txt alongside the sitemap
  5. changefreq: 'monthly', // Set the frequency of page changes
  6. priority: 0.8, // Default priority for pages
  7. sitemapSize: 5000, // Maximum entries per sitemap file
  8. exclude: ['/admin/*', '/dashboard/*', '/404*'], // Exclude specific paths
  9. additionalPaths: async (config) => {
  10. // Custom static paths
  11. const staticPaths = [
  12. await config.transform(config, '/about'),
  13. ];
  14. // Dynamic Dua paths (replace this with API call or database query in production)
  15. const duaSlugs = ["etiquette-of-reciting-the-request-for-entry", "etiquettes-of-carrying-the-janazah", "dua-abu-hamza-thumali"]; // Example dynamic IDs
  16. const dynamicPaths = duaSlugs.map((slug) => ({
  17. loc: `/duas/${slug}`,
  18. lastmod: new Date().toISOString(),
  19. changefreq: 'monthly',
  20. priority: 0.9,
  21. }));
  22. return [...staticPaths, ...dynamicPaths];
  23. },
  24. robotsTxtOptions: {
  25. additionalSitemaps: [
  26. 'https://duasapp.com/sitemap-0.xml', // Add other sitemaps if necessary
  27. ],
  28. },
  29. };