Skip to content

Commit 9793680

Browse files
Merge pull request #5181 from topcoder-platform/seo-fix
Smoke Testing 2020/11/10 - SEO Challenge Listing and Details
2 parents a5c0cc6 + 1bb3ae0 commit 9793680

File tree

4 files changed

+17
-27
lines changed

4 files changed

+17
-27
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ workflows:
237237
filters:
238238
branches:
239239
only:
240-
- apollo-site
240+
- free
241241
# This is alternate dev env for parallel testing
242242
- "build-qa":
243243
context : org-global

src/shared/containers/challenge-detail/index.jsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import Terms from 'containers/Terms';
2727
import termsActions from 'actions/terms';
2828
import ChallengeCheckpoints from 'components/challenge-detail/Checkpoints';
2929
import React from 'react';
30-
import htmlToText from 'html-to-text';
3130
import PT from 'prop-types';
3231
import { connect } from 'react-redux';
3332
import challengeDetailsActions, { TABS as DETAIL_TABS }
@@ -376,15 +375,8 @@ class ChallengeDetailPageContainer extends React.Component {
376375
prizesStr = challenge.prizes.map(p => `$${p}`).join('/');
377376
prizesStr = `[${prizesStr}] - `;
378377
}
379-
const title = challenge.name;
380-
381-
let description = challenge.description || challenge.detailedRequirements;
382-
description = description ? description.slice(0, 256) : '';
383-
description = htmlToText.fromString(description, {
384-
singleNewLineParagraphs: true,
385-
wordwrap: false,
386-
});
387-
description = description.replace(/\n/g, ' ');
378+
const title = 'Topcoder Challenge | Topcoder Community | Topcoder';
379+
const description = 'Browse the challenges currently available on Topcoder. Search by type of challenge, then find those of interest to register for and compete in today.';
388380

389381
const results2 = resultsLoadedForChallengeId === _.toString(challengeId)
390382
? results : null;
@@ -432,10 +424,10 @@ class ChallengeDetailPageContainer extends React.Component {
432424
!isEmpty
433425
&& (
434426
<MetaTags
435-
description={description.slice(0, 155)}
427+
description={description}
436428
image={getOgImage(challenge)}
437429
siteName="Topcoder"
438-
socialDescription={description.slice(0, 200)}
430+
socialDescription={description}
439431
socialTitle={`${prizesStr}${title}`}
440432
title={title}
441433
/>

src/shared/containers/challenge-listing/Listing/index.jsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ const { mapToBackend } = challengeUtils.filter;
3737

3838
let mounted = false;
3939

40-
const SEO_PAGE_TITLE = 'Topcoder Challenges';
41-
4240
export class ListingContainer extends React.Component {
4341
componentDidMount() {
4442
const {
@@ -368,7 +366,6 @@ export class ListingContainer extends React.Component {
368366
challengesUrl,
369367
challengeTags,
370368
communityFilters,
371-
communityId,
372369
communityName,
373370
defaultCommunityId,
374371
expanding,
@@ -494,7 +491,8 @@ export class ListingContainer extends React.Component {
494491
let communityFilter = communityFilters.find(item => item.communityId === selectedCommunityId);
495492
if (communityFilter) communityFilter = communityFilter.challengeFilter;
496493

497-
const description = 'Join Topcoder and compete in these challenges, to learn and earn!';
494+
const title = 'Topcoder Challenge Listings | Topcoder Community | Topcoder';
495+
const description = 'Browse the challenges currently available on Topcoder. Search by type of challenge, then find those of interest to register for and compete in today.';
498496

499497
let banner;
500498
if (!listingOnly) {
@@ -520,7 +518,7 @@ export class ListingContainer extends React.Component {
520518
description={description}
521519
image={ogImage}
522520
siteName="Topcoder"
523-
title={communityId ? `${communityName} Challenges` : SEO_PAGE_TITLE}
521+
title={title}
524522
/>
525523
{banner}
526524
<ChallengeListing

src/shared/routes/Topcoder/ChallengeListing.jsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
import _ from 'lodash';
77
import LoadingIndicator from 'components/LoadingIndicator';
8-
// import path from 'path';
8+
import path from 'path';
99
import qs from 'qs';
1010
import React from 'react';
11-
// import { StaticRouter } from 'react-router-dom';
12-
import { AppChunk } from 'topcoder-react-utils';
11+
import { StaticRouter } from 'react-router-dom';
12+
import { AppChunk, webpack } from 'topcoder-react-utils';
1313

1414
export default function ChallengeListingRoute() {
1515
return (
@@ -39,13 +39,14 @@ export default function ChallengeListingRoute() {
3939
/*
4040
TODO: Making server-side rendering work demands some more efforts
4141
with reducers coding.
42+
*/
4243
renderServer={(renderProps) => {
43-
const p = resolveWeak('containers/challenge-listing/Listing');
44-
const ChallengeListing = requireWeak(path.resolve(__dirname, p));
44+
const p = webpack.resolveWeak('containers/challenge-listing/Listing');
45+
const ChallengeListing = webpack.requireWeak(path.resolve(__dirname, p));
4546
/* TODO: Choice of currency and prize mode should be moved to
46-
* Redux actions / reducers. *//*
47-
const query = renderProps.location.search ?
48-
qs.parse(renderProps.location.search.slice(1)) : null;
47+
* Redux actions / reducers. */
48+
const query = renderProps.location.search
49+
? qs.parse(renderProps.location.search.slice(1)) : null;
4950
const currencyFromUrl = _.get(query, 'currency');
5051
const prizeMode = currencyFromUrl && `money-${currencyFromUrl}`;
5152
return (
@@ -61,7 +62,6 @@ export default function ChallengeListingRoute() {
6162
</StaticRouter>
6263
);
6364
}}
64-
*/
6565
/>
6666
);
6767
}

0 commit comments

Comments
 (0)