File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
dotcom-rendering/src/server Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -648,8 +648,13 @@ <h2>Test Articles By Element (Missing)</h2>
648
648
// All interactive pages include this in the URL
649
649
if ( url . includes ( '/ng-interactive/' ) ) return 'Interactive' ;
650
650
// 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
+ )
652
654
return 'Article' ;
655
+ // This is imperfect, but covers some cases of tag pages, consider expanding in the future
656
+ else if ( url . match ( / \/ ( t o n e | s e r i e s | p r o f i l e ) \/ [ a - z - ] + / ) )
657
+ return 'TagPage' ;
653
658
// Fall back to fronts for all other page types
654
659
else return 'Front' ;
655
660
} ;
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ import {
22
22
} from './handler.front.web' ;
23
23
24
24
/** 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 + $ ) / ;
26
26
/** fronts are a series of lowercase strings, dashes and forward slashes */
27
27
const FRONT_URL = / ^ \/ [ a - z - / ] + (?< ! \. c s s ) $ / ;
28
28
/** This is imperfect, but covers *some* cases of tag pages, consider expanding in the future */
You can’t perform that action at this time.
0 commit comments