Skip to content

Commit 8172690

Browse files
Fix crossword url on dev server
1 parent 740b8ef commit 8172690

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

dotcom-rendering/src/server/dev-index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,8 +648,13 @@ <h2>Test Articles By Element (Missing)</h2>
648648
// All interactive pages include this in the URL
649649
if (url.includes('/ng-interactive/')) return 'Interactive';
650650
// We're looking for the date string, e.g /2022/jul/30
651-
else if (url.match(/[0-9]{4}\/[a-z]{3}\/[0-9]{2}\/.+/))
651+
else if (
652+
url.match(/(\/\d{4}\/[a-z]{3}\/\d{2}\/|\/[a-z-]+\/\d+$)/)
653+
)
652654
return 'Article';
655+
// This is imperfect, but covers some cases of tag pages, consider expanding in the future
656+
else if (url.match(/\/(tone|series|profile)\/[a-z-]+/))
657+
return 'TagPage';
653658
// Fall back to fronts for all other page types
654659
else return 'Front';
655660
};

dotcom-rendering/src/server/server.dev.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
} from './handler.front.web';
2323

2424
/** article URLs contain a part that looks like “2022/nov/25” */
25-
const ARTICLE_URL = /\/\d{4}\/[a-z]{3}\/\d{2}\//;
25+
const ARTICLE_URL = /(\/\d{4}\/[a-z]{3}\/\d{2}\/|\/[a-z-]+\/\d+$)/;
2626
/** fronts are a series of lowercase strings, dashes and forward slashes */
2727
const FRONT_URL = /^\/[a-z-/]+(?<!\.css)$/;
2828
/** This is imperfect, but covers *some* cases of tag pages, consider expanding in the future */

0 commit comments

Comments
 (0)