Skip to content

Commit

Permalink
fix(*): COM-2905 replace hardcore host value with variable
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtyomResh committed Oct 30, 2020
1 parent 87781bd commit ce55fd0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion components/Meta.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { withRouter } from 'next/router'

const Meta = ({ router }) => (
<Head>
<link rel="canonical" href={`https://blog.csssr.com${router.asPath}`} />
<link rel="canonical" href={`${process.env.BLOG_HOST}${router.asPath}`} />
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-48x48.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png" />
Expand Down
2 changes: 1 addition & 1 deletion components/Post/Post.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const Post = ({ post, language, className }) => {
<meta property="article:section" content={post.tag} />
<meta
property="og:url"
content={`https://blog.csssr.com/${language}/article/${post.slug}`}
content={`${process.env.BLOG_HOST}/${language}/article/${post.slug}`}
/>
<meta property="og:title" content={cleaningTitle(post.title, 'meta')} />
<meta property="og:description" content={getDescription(post.content)} />
Expand Down
2 changes: 1 addition & 1 deletion components/main/MainPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const MainPage = ({
<meta property="og:title" content={meta[language].title} />
<meta property="og:description" content={meta[language].description} />
<meta property="og:type" content="website" />
<meta property="og:url" content={`https://blog.csssr.com/${language}`} />
<meta property="og:url" content={`${process.env.BLOG_HOST}/${language}`} />
<meta property="og:image" content={getOriginal(myImageData)} />
</Head>
<Layout language={language}>
Expand Down
4 changes: 2 additions & 2 deletions scripts/generateRobotsTxt.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion scripts/generateSitemapXml.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit ce55fd0

Please sign in to comment.