Skip to content

Commit 2e4fa37

Browse files
Fix SEO to Gigs and Thrive pages
1 parent f3391db commit 2e4fa37

File tree

12 files changed

+148
-36
lines changed

12 files changed

+148
-36
lines changed

src/shared/containers/EDU/Home.jsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
import React from 'react';
55
import { config } from 'topcoder-react-utils';
6-
import { Helmet } from 'react-helmet';
6+
import MetaTags from 'components/MetaTags';
77
import Viewport from 'components/Contentful/Viewport';
88
import SearchBar from 'components/Contentful/SearchBar/SearchBar';
99
import { getService } from 'services/contentful';
@@ -44,15 +44,15 @@ export default class EDUHome extends React.Component {
4444

4545
render() {
4646
const { taxonomy } = this.state;
47+
const title = 'Topcoder Thrive | Topcoder Community | Topcoder';
48+
const description = 'Thrive is our vault of content that we have been gathering over the years. It is full of tutorials and workshops that matter. Grow with us!';
49+
4750
return (
4851
<div className={homeTheme.container}>
49-
<Helmet>
50-
<title>THRIVE - Grow with us. Tutorials and workshops that matter.</title>
51-
<meta name="title" property="og:title" content="THRIVE - Grow with us. Tutorials and workshops that matter." />
52-
<meta name="description" property="og:description" content="THRIVE - Grow with us. Tutorials and workshops that matter." />
53-
<meta name="description" property="description" content="THRIVE - Grow with us. Tutorials and workshops that matter." />
54-
<meta name="twitter:description" content="THRIVE - Grow with us. Tutorials and workshops that matter." />
55-
</Helmet>
52+
<MetaTags
53+
description={description}
54+
title={title}
55+
/>
5656
{/* Banner */}
5757
<div className={homeTheme.bannerContainer}>
5858
<div className={homeTheme.bannerImage} />

src/shared/containers/EDU/Search.jsx

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import _ from 'lodash';
55
import moment from 'moment';
66
import React from 'react';
77
import { config, isomorphy } from 'topcoder-react-utils';
8+
import MetaTags from 'components/MetaTags';
89
import Viewport from 'components/Contentful/Viewport';
910
import SearchBar from 'components/Contentful/SearchBar/SearchBar';
1011
import { getService } from 'services/contentful';
@@ -13,7 +14,6 @@ import { updateQuery } from 'utils/url';
1314
import qs from 'qs';
1415
import LoadingIndicator from 'components/LoadingIndicator';
1516
import SearchPageFilter from 'components/Contentful/SearchPageFilter/SearchPageFilter';
16-
import { Helmet } from 'react-helmet';
1717
// Partials
1818
import ResultTabs from './partials/ResultTabs';
1919
// CSS
@@ -87,18 +87,28 @@ export default class EDUSearch extends React.Component {
8787
const {
8888
taxonomy, query, tree, isShowFilter,
8989
} = this.state;
90+
const title = 'Topcoder Thrive | Topcoder Community | Topcoder';
91+
const description = 'Thrive is our vault of content that we have been gathering over the years. It is full of tutorials and workshops that matter. Grow with us!';
92+
93+
const metaTags = (
94+
<MetaTags
95+
description={description}
96+
title={title}
97+
/>
98+
);
9099
// This container needs at least those variables
91100
// to be able to render meaningful data
92-
if (!taxonomy) return <LoadingIndicator />;
101+
if (!taxonomy) {
102+
return (
103+
<React.Fragment>
104+
{ metaTags }
105+
<LoadingIndicator />;
106+
</React.Fragment>
107+
);
108+
}
93109
return (
94110
<div className={searchTheme.container}>
95-
<Helmet>
96-
<title>THRIVE - Search {`${query.title}`}</title>
97-
<meta name="title" property="og:title" content="THRIVE - Grow with us. Tutorials and workshops that matter." />
98-
<meta name="description" property="og:description" content="THRIVE - Grow with us. Tutorials and workshops that matter." />
99-
<meta name="description" property="description" content="THRIVE - Grow with us. Tutorials and workshops that matter." />
100-
<meta name="twitter:description" content="THRIVE - Grow with us. Tutorials and workshops that matter." />
101-
</Helmet>
111+
{ metaTags }
102112
{/* Banner */}
103113
<div className={searchTheme.bannerContainer}>
104114
<div className={searchTheme.searchBarWrapp}>

src/shared/containers/EDU/Tracks.jsx

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import _ from 'lodash';
55
import moment from 'moment';
66
import React from 'react';
77
import { config, isomorphy } from 'topcoder-react-utils';
8+
import MetaTags from 'components/MetaTags';
89
import Viewport from 'components/Contentful/Viewport';
910
import SearchBar from 'components/Contentful/SearchBar/SearchBar';
1011
import { getService } from 'services/contentful';
@@ -14,7 +15,6 @@ import qs from 'qs';
1415
import TracksTree from 'components/Contentful/TracksTree/TracksTree';
1516
import LoadingIndicator from 'components/LoadingIndicator';
1617
import TracksFilter from 'components/Contentful/TracksFilter/TracksFilter';
17-
import { Helmet } from 'react-helmet';
1818
// SVGs & Assets
1919
import Dev from 'assets/images/img-development.png';
2020
import Design from 'assets/images/img_design.png';
@@ -163,18 +163,28 @@ export default class EDUTracks extends React.Component {
163163
taxonomy, query, tree, isShowFilter,
164164
articleCnt, videoCnt, forumCnt,
165165
} = this.state;
166+
const title = 'Topcoder Thrive | Topcoder Community | Topcoder';
167+
const description = 'Thrive is our vault of content that we have been gathering over the years. It is full of tutorials and workshops that matter. Grow with us!';
168+
169+
const metaTags = (
170+
<MetaTags
171+
description={description}
172+
title={title}
173+
/>
174+
);
166175
// This container needs at least those variables
167176
// to be able to render meaningful data
168-
if (!taxonomy) return <LoadingIndicator />;
177+
if (!taxonomy) {
178+
return (
179+
<React.Fragment>
180+
{ metaTags }
181+
<LoadingIndicator />;
182+
</React.Fragment>
183+
);
184+
}
169185
return (
170186
<div className={tracksTheme.container}>
171-
<Helmet>
172-
<title>THRIVE - {`${query.track}`}</title>
173-
<meta name="title" property="og:title" content="THRIVE - Grow with us. Tutorials and workshops that matter." />
174-
<meta name="description" property="og:description" content="THRIVE - Grow with us. Tutorials and workshops that matter." />
175-
<meta name="description" property="description" content="THRIVE - Grow with us. Tutorials and workshops that matter." />
176-
<meta name="twitter:description" content="THRIVE - Grow with us. Tutorials and workshops that matter." />
177-
</Helmet>
187+
{ metaTags }
178188
{/* Banner */}
179189
<div
180190
className={tracksTheme.bannerContainer}

src/shared/containers/EDU/styles/home.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
.container {
44
display: flex;
5+
flex: 1;
56
flex-direction: column;
6-
overflow: hidden;
7+
width: 100%;
78

89
.bannerContainer {
910
background-image: linear-gradient(98.81deg, #8b41b0 0%, #ef476f 100%);

src/shared/containers/EDU/styles/search.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
.container {
44
display: flex;
5+
flex: 1;
56
flex-direction: column;
6-
overflow: hidden;
7+
width: 100%;
78

89
.bannerContainer {
910
background-color: #2a2a2a;

src/shared/containers/EDU/styles/tracks.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
.container {
44
display: flex;
5+
flex: 1;
56
flex-direction: column;
6-
overflow: hidden;
7+
width: 100%;
78

89
.bannerContainer {
910
min-height: 475px;

src/shared/containers/GigsPages.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@ import Viewport from 'components/Contentful/Viewport';
99
import { config } from 'topcoder-react-utils';
1010
import RecruitCRMJobDetails from 'containers/Gigs/RecruitCRMJobDetails';
1111
import { Helmet } from 'react-helmet';
12+
import MetaTags from 'components/MetaTags';
1213

1314

1415
export default function GigsPagesContainer(props) {
1516
const { match } = props;
1617
const { id } = match.params;
1718
const isApply = `${config.GIGS_PAGES_PATH}/${id}/apply` === match.url;
19+
const title = 'Gig Work | Topcoder Community | Topcoder';
20+
const description = 'Compete and build up your profiles and skills! Topcoder members become eligible to work on Gig Work projects by first proving themselves in various skill sets through Topcoder competitions.';
1821
return (
1922
<div>
2023
<Helmet>
21-
<title>Topcoder - Gig Work Opportunities</title>
2224
<script type="text/javascript">{`
2325
window._chatlio = window._chatlio||[];
2426
!function(){ var t=document.getElementById("chatlio-widget-embed");if(t&&window.ChatlioReact&&_chatlio.init)return void _chatlio.init(t,ChatlioReact);for(var e=function(t){return function(){_chatlio.push([t].concat(arguments)) }},i=["configure","identify","track","show","hide","isShown","isOnline", "page", "open", "showOrHide"],a=0;a<i.length;a++)_chatlio[i[a]]||(_chatlio[i[a]]=e(i[a]));var n=document.createElement("script"),c=document.getElementsByTagName("script")[0];n.id="chatlio-widget-embed",n.src="https://w.chatlio.com/w.chatlio-widget.js",n.async=!0,n.setAttribute("data-embed-version","2.3");
@@ -28,6 +30,10 @@ window._chatlio = window._chatlio||[];
2830
`}
2931
</script>
3032
</Helmet>
33+
<MetaTags
34+
description={description}
35+
title={title}
36+
/>
3137
<Header />
3238
{
3339
id ? (

src/shared/routes/EDUHome.jsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* The loader of EDUHome page webpack chunks.
3+
*/
4+
import path from 'path';
5+
import React from 'react';
6+
import LoadingPagePlaceholder from 'components/LoadingPagePlaceholder';
7+
import { AppChunk, webpack } from 'topcoder-react-utils';
8+
9+
export default function EDUHome(props) {
10+
return (
11+
<AppChunk
12+
chunkName="eduHome/chunk"
13+
renderClientAsync={() => import(/* webpackChunkName: "eduHome/chunk" */ 'containers/EDU/Home')
14+
.then(({ default: Home }) => (
15+
<Home {...props} />
16+
))
17+
}
18+
renderPlaceholder={() => <LoadingPagePlaceholder />}
19+
renderServer={() => {
20+
const p = webpack.resolveWeak('containers/EDU/Home');
21+
const Home = webpack.requireWeak(path.resolve(__dirname, p));
22+
return <Home {...props} />;
23+
}}
24+
/>
25+
);
26+
}

src/shared/routes/EDUSearch.jsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* The loader of EDUSearch page webpack chunks.
3+
*/
4+
import path from 'path';
5+
import React from 'react';
6+
import LoadingPagePlaceholder from 'components/LoadingPagePlaceholder';
7+
import { AppChunk, webpack } from 'topcoder-react-utils';
8+
9+
export default function EDUSearch(props) {
10+
return (
11+
<AppChunk
12+
chunkName="eduSearch/chunk"
13+
renderClientAsync={() => import(/* webpackChunkName: "eduSearch/chunk" */ 'containers/EDU/Search')
14+
.then(({ default: Search }) => (
15+
<Search {...props} />
16+
))
17+
}
18+
renderPlaceholder={() => <LoadingPagePlaceholder />}
19+
renderServer={() => {
20+
const p = webpack.resolveWeak('containers/EDU/Search');
21+
const Search = webpack.requireWeak(path.resolve(__dirname, p));
22+
return <Search {...props} />;
23+
}}
24+
/>
25+
);
26+
}

src/shared/routes/EDUTracks.jsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* The loader of EDUTracks page webpack chunks.
3+
*/
4+
import path from 'path';
5+
import React from 'react';
6+
import LoadingPagePlaceholder from 'components/LoadingPagePlaceholder';
7+
import { AppChunk, webpack } from 'topcoder-react-utils';
8+
9+
export default function EDUTracks(props) {
10+
return (
11+
<AppChunk
12+
chunkName="eduTracks/chunk"
13+
renderClientAsync={() => import(/* webpackChunkName: "eduTracks/chunk" */ 'containers/EDU/Tracks')
14+
.then(({ default: Tracks }) => (
15+
<Tracks {...props} />
16+
))
17+
}
18+
renderPlaceholder={() => <LoadingPagePlaceholder />}
19+
renderServer={() => {
20+
const p = webpack.resolveWeak('containers/EDU/Tracks');
21+
const Tracks = webpack.requireWeak(path.resolve(__dirname, p));
22+
return <Tracks {...props} />;
23+
}}
24+
/>
25+
);
26+
}

src/shared/routes/GigsPages.jsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
/**
22
* The loader of Gigs page webpack chunks.
33
*/
4+
import path from 'path';
45
import React from 'react';
5-
66
import LoadingPagePlaceholder from 'components/LoadingPagePlaceholder';
7-
import { AppChunk } from 'topcoder-react-utils';
7+
import { AppChunk, webpack } from 'topcoder-react-utils';
88

99
export default function GigsPagesRoute(props) {
1010
return (
1111
<AppChunk
12-
chunkName="policyPages/chunk"
12+
chunkName="gigsPages/chunk"
1313
renderClientAsync={() => import(/* webpackChunkName: "gigsPages/chunk" */ 'containers/GigsPages')
1414
.then(({ default: GigsPagesContainer }) => (
1515
<GigsPagesContainer {...props} />
1616
))
1717
}
1818
renderPlaceholder={() => <LoadingPagePlaceholder />}
19+
renderServer={() => {
20+
const p = webpack.resolveWeak('containers/GigsPages');
21+
const GigsPagesContainer = webpack.requireWeak(path.resolve(__dirname, p));
22+
return <GigsPagesContainer {...props} />;
23+
}}
1924
/>
2025
);
2126
}

src/shared/routes/Topcoder/Routes.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ import ContentfulLoader from 'containers/ContentfulLoader';
2222
import LoadingIndicator from 'components/LoadingIndicator';
2323
import Article from 'components/Contentful/Article';
2424

25-
import EDUHome from 'containers/EDU/Home';
26-
import EDUTracks from 'containers/EDU/Tracks';
27-
import EDUSearch from 'containers/EDU/Search';
25+
import EDUHome from '../EDUHome';
26+
import EDUTracks from '../EDUTracks';
27+
import EDUSearch from '../EDUSearch';
2828
import ChallengeListing from './ChallengeListing';
2929
import Dashboard from './Dashboard';
3030
import Notifications from './Notifications';

0 commit comments

Comments
 (0)