feat: sitemap and robots txt

This commit is contained in:
2021-02-15 22:36:11 +00:00
parent 0eb06ff592
commit fc30fc015f
3 changed files with 290 additions and 2 deletions

View File

@@ -1,8 +1,18 @@
const path = require("path");
const { GMAPS_APIKEY } = process.env;
const {
NODE_ENV,
URL: NETLIFY_SITE_URL = `https://abcprojectdesign.com`,
DEPLOY_PRIME_URL: NETLIFY_DEPLOY_URL = NETLIFY_SITE_URL,
CONTEXT: NETLIFY_ENV = NODE_ENV
} = process.env;
const isNetlifyProduction = NETLIFY_ENV === "production";
const siteUrl = isNetlifyProduction ? NETLIFY_SITE_URL : NETLIFY_DEPLOY_URL;
module.exports = {
siteMetadata: {
siteUrl,
title: `ABC Project Design`,
description: `Easy as ABC`,
keywords: `Bathroom Tiling Fitting Installation London Essex Suffolk Hertfordshire`,
@@ -54,6 +64,27 @@ module.exports = {
display: `standalone`
}
},
{
resolve: `gatsby-plugin-robots-txt`,
options: {
resolveEnv: () => NETLIFY_ENV,
env: {
production: {
policy: [{ userAgent: `*` }]
},
"branch-deploy": {
policy: [{ userAgent: `*`, disallow: [`/`] }],
sitemap: null,
host: null
},
"deploy-preview": {
policy: [{ userAgent: `*`, disallow: [`/`] }],
sitemap: null,
host: null
}
}
}
},
{
resolve: `gatsby-source-filesystem`,
options: {
@@ -69,6 +100,7 @@ module.exports = {
}
}
},
`gatsby-plugin-sitemap`,
`gatsby-plugin-react-helmet`,
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,