npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

gatsby-plugin-sitemap-html

v1.2.2

Published

Gatsby plugin that extends gatsby-plugin-sitemap to generate HTML-styled sitemaps using XSL

Readme

gatsby-plugin-sitemap-html

npm version License: MIT CI codecov

A Gatsby plugin that extends gatsby-plugin-sitemap to generate human-readable, HTML-styled sitemaps using XSL. Transform your XML sitemaps into beautiful, browser-friendly pages that both users and search engines can appreciate.

✨ Features

  • 🎨 Beautiful HTML styling - Makes sitemaps human-readable in browsers
  • 🔧 Zero configuration - Works out of the box with sensible defaults
  • 🎯 Customizable - Bring your own XSL template if needed
  • 📦 Lightweight - Minimal dependencies
  • 🚀 SEO-friendly - Maintains XML structure for search engines
  • 🔄 Automatic processing - Handles sitemap index and all sitemap files

📦 Installation

npm install gatsby-plugin-sitemap gatsby-plugin-sitemap-html

Or with yarn:

yarn add gatsby-plugin-sitemap gatsby-plugin-sitemap-html

Or with pnpm:

pnpm add gatsby-plugin-sitemap gatsby-plugin-sitemap-html

🚀 Quick Start

Add the plugin to your gatsby-config.js. Important: Add it after gatsby-plugin-sitemap:

module.exports = {
  siteMetadata: {
    siteUrl: 'https://www.example.com',
  },
  plugins: [
    'gatsby-plugin-sitemap',
    'gatsby-plugin-sitemap-html',
  ],
};

That's it! Build your site and visit /sitemap.xml in your browser to see the styled sitemap.

⚙️ Configuration

Basic Configuration

module.exports = {
  plugins: [
    'gatsby-plugin-sitemap',
    {
      resolve: 'gatsby-plugin-sitemap-html',
      options: {
        // Optional: path to custom XSL template
        xslTemplate: `${__dirname}/src/templates/custom-sitemap.xsl`,
      },
    },
  ],
};

Custom Output Path

module.exports = {
  plugins: [
    {
      resolve: 'gatsby-plugin-sitemap',
      options: {
        output: '/sitemaps',
      },
    },
    {
      resolve: 'gatsby-plugin-sitemap-html',
      options: {
        output: '/sitemaps', // Must match gatsby-plugin-sitemap
      },
    },
  ],
};

Options

| Option | Type | Default | Description | | ----------- | ------ | ----------------- | --------------------------------------------------------------------------- | | xslTemplate | string | built-in template | Path to a custom XSL template file (optional) | | output | string | / | Folder path where sitemaps are stored (must match gatsby-plugin-sitemap) |

📖 How It Works

  1. gatsby-plugin-sitemap generates your sitemap files (sitemap-index.xml, sitemap-0.xml, etc.)
  2. This plugin automatically:
    • Copies the XSL stylesheet to your public directory
    • Injects XSL references into all sitemap files
    • Renames sitemap-index.xml to sitemap.xml for standard naming
  3. When users visit your sitemap in a browser, they see a styled HTML page
  4. Search engines still see the standard XML structure

🎨 Custom Styling

To customize the appearance of your sitemap:

  1. Create a custom XSL file (you can copy from node_modules/gatsby-plugin-sitemap-html/templates/sitemap.xsl)
  2. Modify the styles and layout as needed
  3. Reference it in your config:
{
  resolve: 'gatsby-plugin-sitemap-html',
  options: {
    xslTemplate: './src/templates/my-sitemap.xsl',
  },
}

📚 Documentation

🔍 Example

Check the example directory for a complete working demo.

To run the example:

cd example
pnpm install
pnpm run build
pnpm run serve

Then visit http://localhost:9000/sitemap.xml

🤝 Contributing

Contributions are welcome! Please read our Contributing Guide for details.

Please note that this project is released with a Code of Conduct. By participating in this project you agree to abide by its terms.

🔒 Security

See our Security Policy for reporting vulnerabilities.

📝 Changelog

See CHANGELOG.md for release history.

📄 License

MIT © Ketan Patel

🙏 Acknowledgments


If you find this plugin helpful, please ⭐ star the repo!