New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@superrb/gatsby-plugin-multi-language-sitemap

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@superrb/gatsby-plugin-multi-language-sitemap

Gatsby plugin that automatically creates a sitemap supporting multi-language for your site

  • 1.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

💎Gatsby-plugin-multi-language-sitemap

Create a sitemap for your Gatsby site.

The plugin is a fork of gatsby-plugin-sitemap . This forked version has support multiple languages support, designed for aftership.

🧸How to use it?

1.create a gatsby project
gatsby new demo
cd demo
2. install package
# npm
npm i gatsby-plugin-multi-language-sitemap
# yarn
yarn add gatsby-plugin-multi-language-sitemap
3. config sitemap plugin at gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-multi-language-sitemap`,
      options: {
        output: '/',
        query: `
          query {
            allSitePage {
              nodes {
                path
              }
            }
            site {
              siteMetadata {
                siteUrl
              }
            }
          }
        `,
        langs: ['en', 'de', 'fr', 'es', 'zh-Hant', 'zh-Hans'],
      },
    }
  ]
}

The plugin distinguish the language by the url prefix.

For example, if your url like below format. The sitemap plugin will take effect.

https://gatsbystarterdefaultsource.gatsbyjs.io/app
https://gatsbystarterdefaultsource.gatsbyjs.io/en/app
https://gatsbystarterdefaultsource.gatsbyjs.io/fr/app
https://gatsbystarterdefaultsource.gatsbyjs.io/zh-Hans/app
https://gatsbystarterdefaultsource.gatsbyjs.io/jp/app

and the langs param will be

langs: ['en', 'fr', 'zh-Hans', 'jp']
4. run commands below, you can see the sitemap in /public/ folder, sitemap-index.xml x-default-sitemap.xml screenshot below.
yarn build

image-20210715142625438

image-20210715142851589

https://www.gatsbyjs.com/plugins/gatsby-plugin-sitemap/

Keywords

FAQs

Package last updated on 23 May 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