Home

Awesome

rspress-plugin-sitemap NPM Version

Rspress plugin for Automatically generate SEO(Search Engine Optimization)-related sitemaps

Usage

npm i rspress-plugin-sitemap
yarn add rspress-plugin-sitemap
pnpm add rspress-plugin-sitemap
import { defineConfig } from "rspress/config";
import sitemap from "rspress-plugin-sitemap";

export default defineConfig({
  plugins: [
    sitemap({
      domain: "https://rspress.dev",
      customMaps: {
        "/sample": {
          loc: "/sample",
          lastmod: "2024-04-27T07:44:43.422Z",
          priority: "0.7",
          changefreq: "always",
        },
      },
      defaultChangeFreq: "monthly",
      defaultPriority: "0.5",
    }),
  ],
});

Configure

This plugin supports passing in an object configuration. The properties of this object configuration are as follows:

interface Options {
  domain?: string; // your domain
  customMaps?: CustomMaps; // custom your sitemap
  defaultPriority?: Priority; // defaultPriority 0.5
  defaultChangeFreq?: ChangeFreq; // defaultPriority monthly
}