@times-components/ssr 2.62.32-e39008ab24df5aff38632e6efaa3f8faf8e08116.5 → 2.62.32-efee292987f933a77af7da60a3032530c468392b.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@times-components/ssr",
|
|
3
3
|
"main": "src",
|
|
4
|
-
"version": "2.62.32-
|
|
4
|
+
"version": "2.62.32-efee292987f933a77af7da60a3032530c468392b.3+efee292987",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"bundle:dev": "yarn cleanup-dist && webpack --config=webpack.config.js",
|
|
7
7
|
"bundle:prod": "yarn cleanup-dist && NODE_ENV=production webpack --config=webpack.config.js -p",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"webpack": "4.30.0"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@times-components/article": "^7.19.20-
|
|
56
|
-
"@times-components/author-profile": "^6.20.
|
|
55
|
+
"@times-components/article": "^7.19.20-efee292987f933a77af7da60a3032530c468392b.3+efee292987",
|
|
56
|
+
"@times-components/author-profile": "^6.20.9",
|
|
57
57
|
"@times-components/context": "^1.25.11",
|
|
58
58
|
"@times-components/provider": "^1.45.1",
|
|
59
59
|
"@times-components/schema": "^0.7.5",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"publishConfig": {
|
|
80
80
|
"access": "public"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "efee292987f933a77af7da60a3032530c468392b"
|
|
83
83
|
}
|
package/src/component/article.js
CHANGED
|
@@ -57,6 +57,27 @@ module.exports = (client, analyticsStream, data, helmetContext) => {
|
|
|
57
57
|
: providerData.article;
|
|
58
58
|
const articleTemplate = article ? article.template : null;
|
|
59
59
|
|
|
60
|
+
const sectionPath = article ? getSectionNameForAnalytics(article) : "";
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
// --- Inline section transformation ---
|
|
64
|
+
const sectionData = {};
|
|
65
|
+
if (sectionPath) {
|
|
66
|
+
const cleanRoute = sectionPath.replace(/^\/|\/$/g, '');
|
|
67
|
+
const parts = cleanRoute
|
|
68
|
+
.split('/')
|
|
69
|
+
.filter(Boolean)
|
|
70
|
+
.map(part => part.charAt(0).toUpperCase() + part.slice(1));
|
|
71
|
+
|
|
72
|
+
let cumulative = '';
|
|
73
|
+
parts.forEach((part, index) => {
|
|
74
|
+
cumulative = cumulative ? `${cumulative}:${part}` : part;
|
|
75
|
+
const key = index === 0 ? 'page_section' : `page_section_${index + 1}`;
|
|
76
|
+
sectionData[key] = cumulative;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
60
81
|
return React.createElement(
|
|
61
82
|
ContextProviderWithDefaults,
|
|
62
83
|
{
|
|
@@ -78,10 +99,9 @@ module.exports = (client, analyticsStream, data, helmetContext) => {
|
|
|
78
99
|
analyticsStream,
|
|
79
100
|
article: {
|
|
80
101
|
...article,
|
|
81
|
-
section:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
isPreview
|
|
102
|
+
section: sectionPath || "unknown section",
|
|
103
|
+
isPreview,
|
|
104
|
+
...sectionData // ✅ Add page_section/page_section_2/etc. here
|
|
85
105
|
},
|
|
86
106
|
error,
|
|
87
107
|
isLoading,
|