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

@elderjs/plugin-sitemap

Package Overview
Dependencies
Maintainers
2
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elderjs/plugin-sitemap

Easily generate a sitemap for your Elder.js powered website.

  • 1.8.0-beta.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Elder.js Plugin: Sitemap

Easily generate a sitemap for your Elder.js website.

By default it will build a sitemap when you build your Elder.js site.

This sitemap will include a sub-sitemap for each route.

Currently there is a hard limit of 50,000 urls per sub-sitemap.

Install

npm install --save @elderjs/plugin-sitemap

Config

Once installed, open your elder.config.js and configure the plugin by adding @elderjs/plugin-sitemap to your plugin object.

plugins: {

  '@elderjs/plugin-sitemap': {
    origin: '', // the https://yourdomain.com
    exclude: [], // an array of permalinks or permalink prefixes. So you can do ['500'] and it will match /500**
    routeDetails: {}, // set custom priority and change freq if not it falls back to default
    lastUpdate: {}, // configurable last update for each route type.
  },

}

Configuring Route Specific Details

plugins: {
  '@elderjs/plugin-sitemap': {
    origin: '', // the https://yourdomain.com
    exclude: [], // an array of permalinks or permalink prefixes. So you can do ['500'] and it will match /500**
    routeDetails: {
      home: {
        priority: 1.0,
        changefreq: 'monthly',
      },
      blog: {
        priority: 0.8,
        changfreq: 'monthly',
      }
    }, // set custom priority and change freq if not it falls back to default
    lastUpdate: { // configurable last update for each route type.
      home: '2020-01-01',
      blog: async ({ query, request }) => {
        // receives the query prop from hooks. This allows you to hit your db or api or anything else configured on your query object.
        // return a date object.
        return new Date(Date.now());
      }
    }, 
  },
}

Exclusion Logic is Greedy

For example excluding 'green' route

exclude: ['green'],

would excude all routes starting with 'green', also 'greenland' and 'green-eggs'

'green' route could be explicitly excluded with

exclude: ['green/'],

Also nested routes or specific slugs of route could be excluded with

exclude: ['green/', 'greenland/polar-bear'],

Keywords

FAQs

Package last updated on 15 Jul 2022

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