Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More ā†’
Socket
Sign inDemoInstall
Socket

next-sitemap

Package Overview
Dependencies
Maintainers
1
Versions
248
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-sitemap

Sitemap generator for next.js

  • 4.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
328K
decreased by-6.73%
Maintainers
1
Weekly downloads
Ā 
Created

What is next-sitemap?

The next-sitemap npm package is a tool designed to generate sitemaps and robots.txt files for Next.js projects. It simplifies the process of creating these files, which are essential for SEO and ensuring that search engines can efficiently crawl and index your website.

What are next-sitemap's main functionalities?

Generate Sitemap

This feature allows you to generate a sitemap for your Next.js project. By specifying the siteUrl and other options, you can create a sitemap that helps search engines understand the structure of your website.

module.exports = {
  siteUrl: 'https://example.com',
  generateRobotsTxt: true, // (optional)
  // ...other options
}

Custom Robots.txt

This feature allows you to generate a custom robots.txt file. You can specify different policies for different user agents, which helps control how search engines crawl your site.

module.exports = {
  siteUrl: 'https://example.com',
  generateRobotsTxt: true,
  robotsTxtOptions: {
    policies: [
      { userAgent: '*', allow: '/' },
      { userAgent: 'Googlebot', disallow: '/nogoogle' },
    ],
  },
}

Additional Paths

This feature allows you to add additional paths to your sitemap that are not automatically included. This is useful for including dynamically generated pages or other custom routes.

module.exports = {
  siteUrl: 'https://example.com',
  generateRobotsTxt: true,
  additionalPaths: async (config) => [
    await config.transform(config, '/additional-page')
  ],
}

Exclude Paths

This feature allows you to exclude specific paths from your sitemap. This is useful for preventing certain pages, such as admin or login pages, from being indexed by search engines.

module.exports = {
  siteUrl: 'https://example.com',
  generateRobotsTxt: true,
  exclude: ['/admin/*', '/login'],
}

Other packages similar to next-sitemap

Keywords

FAQs

Package last updated on 04 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with āš”ļø by Socket Inc