1

I'm using "gatsby-plugin-sitemap": "^2.4.2" tho, it doesn't work after install "gatsby-plugin-intl": "^0.3.3" on Amplify even tho it works on Local env well.

This is the URL, but automatically it's moved to https://www.babylook.mom/.

https://www.babylook.mom/sitemap.xml

Below is the gatsby-config.js

{
   resolve: `gatsby-plugin-sitemap`,
   options: {
     output: `/sitemap.xml`,
   }
},
{
  resolve: `gatsby-plugin-intl`,
  options: {
    path: `${__dirname}/src/intl`,
    languages: [`en`, `es`, `zh`],
    defaultLanguage: `en`,
    redirect: false,
  },
},  
John Conde
  • 217,595
  • 99
  • 455
  • 496
uekyo
  • 421
  • 1
  • 4
  • 18

1 Answers1

0

The plugin's order is important in Gatsby, try putting the gatsby-plugin-intl above since it's the one in charge of prefix all the URLs with the provided locales:

{
  resolve: `gatsby-plugin-intl`,
  options: {
    path: `${__dirname}/src/intl`,
    languages: [`en`, `es`, `zh`],
    defaultLanguage: `en`,
    redirect: false,
  },
},  
{
   resolve: `gatsby-plugin-sitemap`,
   options: {
     output: `/sitemap.xml`,
   }
},

In addition, you may want to explore all the query options that the gatsby-plugin-sitemap provides.

Ferran Buireu
  • 28,630
  • 6
  • 39
  • 67
  • Thank you for your advice. I tried to add all query options and also change the plugin order. However, the sitemap doesn't appear. Instead of it, it's moved to the top url. – uekyo Jan 06 '21 at 19:20