Skip to content

Commit

Permalink
Fix/64 add hreflang tag (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
rawic authored Feb 19, 2023
1 parent 5e55398 commit c1d12b1
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
const { languages, defaultLanguage } = require('./languages');
const path = require('path');
const siteUrl = process.env.URL || `https://rawic.me`;
// const siteUrl = process.env.URL || `https://rawic.me`;
const {
NODE_ENV,
URL: NETLIFY_SITE_URL = 'https://rawic.me/',
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: {
Expand Down Expand Up @@ -197,9 +205,24 @@ module.exports = {
{
resolve: 'gatsby-plugin-robots-txt',
options: {
host: 'https://rawic.me',
sitemap: 'https://rawic.me/sitemap-index.xml',
policy: [{ userAgent: '*', allow: '/' }],
resolveEnv: () => NETLIFY_ENV,
env: {
production: {
policy: [{ userAgent: '*', allow: '/', disallow: ['/*.pdf'] }],
host: 'https://rawic.me',
sitemap: 'https://rawic.me/sitemap-index.xml',
},
'branch-deploy': {
policy: [{ userAgent: '*', disallow: ['/'] }],
sitemap: null,
host: null,
},
'deploy-preview': {
policy: [{ userAgent: '*', disallow: ['/'] }],
sitemap: null,
host: null,
},
},
},
},
'gatsby-plugin-remove-serviceworker',
Expand Down

0 comments on commit c1d12b1

Please sign in to comment.