From ce55fd0d34f0888c14eb8df385c3f0aca94da540 Mon Sep 17 00:00:00 2001 From: Artyom Resh Date: Fri, 30 Oct 2020 15:09:35 +0300 Subject: [PATCH] fix(*): COM-2905 replace hardcore host value with variable --- components/Meta.jsx | 2 +- components/Post/Post.jsx | 2 +- components/main/MainPage.jsx | 2 +- scripts/generateRobotsTxt.js | 4 ++-- scripts/generateSitemapXml.js | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/Meta.jsx b/components/Meta.jsx index ad4b5b79d..85871157c 100644 --- a/components/Meta.jsx +++ b/components/Meta.jsx @@ -3,7 +3,7 @@ import { withRouter } from 'next/router' const Meta = ({ router }) => ( - + diff --git a/components/Post/Post.jsx b/components/Post/Post.jsx index 63c024b08..0ffe1fb15 100644 --- a/components/Post/Post.jsx +++ b/components/Post/Post.jsx @@ -18,7 +18,7 @@ const Post = ({ post, language, className }) => { diff --git a/components/main/MainPage.jsx b/components/main/MainPage.jsx index 19941a55e..0f441fd73 100644 --- a/components/main/MainPage.jsx +++ b/components/main/MainPage.jsx @@ -38,7 +38,7 @@ const MainPage = ({ - + diff --git a/scripts/generateRobotsTxt.js b/scripts/generateRobotsTxt.js index 1aa7fc485..05c8fd395 100644 --- a/scripts/generateRobotsTxt.js +++ b/scripts/generateRobotsTxt.js @@ -4,9 +4,9 @@ const path = require('path') const robotsTxtContent = process.env.IS_PRODUCTION === 'TRUE' ? `User-agent: * -Sitemap: https://blog.csssr.com/sitemap.xml` +Sitemap: ${process.env.BLOG_HOST}/sitemap.xml` : `User-agent: * Disallow: / -Sitemap: https://blog.csssr.com/sitemap.xml` +Sitemap: ${process.env.BLOG_HOST}/sitemap.xml` fs.writeFileSync(path.resolve(__dirname, '../out/robots.txt'), robotsTxtContent) diff --git a/scripts/generateSitemapXml.js b/scripts/generateSitemapXml.js index 854621256..a48ae4fff 100644 --- a/scripts/generateSitemapXml.js +++ b/scripts/generateSitemapXml.js @@ -29,7 +29,7 @@ const generateSitemap = async () => { ...postsLinks.flat(), ] - const stream = new SitemapStream({ hostname: 'https://blog.csssr.com/' }) + const stream = new SitemapStream({ hostname: process.env.BLOG_HOST }) links.forEach((link) => stream.write(link))